Re:Crossbeam – Tools for concurrent programming in Rust
by ______-_-______ on Sunday April 17, 2022 @10:00AM
(#31060864)
It's not due to the memory model; it's due to the lack of a runtime. In Go/Java, virtual threads are provided by a runtime. Rust tries to stay close to the metal, and so has no runtime. It does not have virtual threads that could be suspended.
Rust used to have virtual threads pre-1.0, but they were removed since the overhead was deemed unacceptable.
However I would be interested in hearing what the specific Rust features (or lack thereof) that prevent this being possible. If it's possible to swap the async runtime out it seems like it should also be possible to add enough runtime to a Rust program to allow the equivalent of virtual threads as long as stuff uses stdlib sockets, file I/O etc.