|
|
|
|
|
by Tamschi
1219 days ago
|
|
It's "Tokio". Coroutines in Rust are a native language feature and their API is part of `std`, but the executors indeed come from community libraries. Tokio is one option, but as long as you don't contextually fork (for parallelism) you can in theory run the same coroutines on any other executor, like the ones from async-std.
Spawning a sibling task (as opposed to mixed child task polling, which can be macroed inline) unfortunately isn't available through the common API so far, which is where the bulk of the mentioned incompatibilities stems from. |
|
In other words, it seems Rust co-routines at the level of Tokio are not as performant as C++ native Co-routines [2] and further down the thread, it's mentioned that once generators are stabilized, it might help build lower cost and performant stackless coroutines in Rust.[3]
[1] https://github.com/rust-lang/rust/issues/43122#issuecomment-...
[2] https://github.com/rust-lang/rust/issues/43122#issuecomment-...
[3] https://github.com/rust-lang/rust/issues/43122#issuecomment-...