4 ms·
1. long ago, we used to have green threads and a runtime 2. we decided to eschew the runtime, and therefore, the green threads. 3. Since then, various librari
by steveklabnik 9y ago
1. long ago, we used to have green threads and a runtime
2. we decided to eschew the runtime, and therefore, the green threads.
3. Since then, various libraries have implemented green threads in various ways
4. Tokio is basically green threads today. It really depends on what you mean exactly by "green threads".; but it schedules N tasks on M OS threads, so...
- vanderZwan 9y agoThank you for clarifying! > 2. we decided to eschew the runtime, and therefore, the green threads. The most important bit I guess, regarding the question of whether Rust will ever have green threads/fibers/trails/whatever (answer: no, because no runtime).
- steveklabnik 9y agoNot built into Rust, yes. But since Rust has no runtime, if you want those things, you can bring them along, as a library. The danger there is splitting an ecosystem, but in general the community has been sensitive to this, and once Tokio was determined as the way forward, the other projects stopped to throw their weight behind it too.