2 ms·
> I don't know Scala or Erlang, but based on the results I would assume both are allocating a posix thread for each thread in the software and so it is using th
by pcwalton 11y ago
> I don't know Scala or Erlang, but based on the results I would assume both are allocating a posix thread for each thread in the software and so it is using the kernel scheduler to switch between them with all the overhead that entails.
Incorrect.
> I have been considering threading in Rust vs Go and that is the biggest difference I see between the approaches. However it should be possible to implement Go style goroutines in Rust using custom dispatch code like old C coroutines. I think I have already seen libraries like that, but I haven't dug in the details to know for sure.
There is https://github.com/dpc/mioco https://github.com/dpc/mioco for I/O-based coroutines. For CPU bound tasks you want something like https://github.com/nikomatsakis/rayon https://github.com/nikomatsakis/rayon.