Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


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 don'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: