3 ms·
Incorrect. If you don't have to provide POSIX thread semantics, then a user space thread can be much smaller than a OS thread; for example, an Erlang process c
by the_why_of_y 8y ago
Incorrect.
If you don't have to provide POSIX thread semantics, then a user space thread can be much smaller than a OS thread; for example, an Erlang process can be as small as 1.2 KB [1], and a thread in GHC's runtime can be even smaller than that [2, section 4].
With both of these, the programmer writes synchronous code that blocks on IO, and the runtime is responsible for turning that into async IO operations at the OS level.
[1] http://erlang.org/doc/efficiency_guide/processes.html http://erlang.org/doc/efficiency_guide/processes.html
[2] https://www.microsoft.com/en-us/research/wp-content/uploads/2009/09/multicore-ghc.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...