3 ms·
There are some examples of speed difference at https://en.m.wikipedia.org/wiki/Green_threads https://en.m.wikipedia.org/wiki/Green_threads Basically if you hav
by viraptor 11y ago
There are some examples of speed difference at https://en.m.wikipedia.org/wiki/Green_threads https://en.m.wikipedia.org/wiki/Green_threads
Basically if you have green threads with only one core, you don't need to do as much work with locking.
- saurik 11y agoThe argument here is less about the performance difference existing or not, and that the decision in question sounds to have been made due to the lack of something we care less about.
- viraptor 11y agoI was responding to the first paragraph, which is technically all about the performance differences. (it does say "How could it be the case that virtual threads implemented in user space are faster than native threads provided by the OS?") Whether that matters and is a valid decision point is a completely different question as you say.
- derefr 11y ago> Basically if you have green threads with only one core, you don't need to do as much work with locking. This is half the basis for the original design of the Erlang BEAM VM. SMP was a grudging afterthought; the original concept was that each VM "node" was a single scheduler process bound to a single core, and then you tied those nodes together into a (machine-internal) multi-core distributed system, effectively creating a set of "threads" communicating over socket-based message-passing IPC, rather than shared memory. M:N scheduling—where, critically, a task can be re-scheduled from one core to another—is a much more complex and less-predictable design, that's not always worth the trouble. For Erlang's particular use-cases, it turned out to be worth the trouble enough to justify programming it, eventually. But the SMP VM is still only built via a configure flag, rather than displacing the M:1 VM as "the" VM.