3 ms·
So with another async runtime it's possible to write async Rust that doesn't need to be thread-safe??? Can you show some example?
by brabel 3y ago
So with another async runtime it's possible to write async Rust that doesn't need to be thread-safe??? Can you show some example?
- awused 3y agoYou don't even need other runtimes for this. Tokio includes a single-threaded runtime and tools for dealing with tasks that aren't thread safe, like LocalSet and spawn_local, that don't require the future to be Send.
- Pauan 3y agoEvery executor (including tokio) supports spawning Futures that aren't Send: https://docs.rs/tokio/1.32.0/tokio/task/fn.spawn_local.html https://docs.rs/tokio/1.32.0/tokio/task/fn.spawn_local.html There is a lot of misinformation in this thread, with people not knowing what they're talking about.