Re:Async Rust Is A Bad Language
by brabel on Friday September 08, 2023 @02:19PM
(#37437317)
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?
[ Parent
| on HN ]
You 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 doesn't require the future to be Send.
Every executor (including tokio) supports spawning Futures that aren't Send:
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.