Re:Tokio 1.0 – async runtime for Rust
by sanxiyn on Wednesday December 23, 2020 @06:02PM
(#25523311)
I think the point is that you can omit atomics in async case, if you are always using async in single thread mode.
[ Parent
| on HN ]
Re:Tokio 1.0 – async runtime for Rust
by thegeomaster on Wednesday December 23, 2020 @07:05PM
(#25523761)
Not just atomics, you'd probably need mutexes or rwlocks in a lot of scenarios, and these can become a bottleneck quickly if you don't think it through. Async has the benefit of context switches (handing off execution) being explicit, so you're fine as long as you don't leave any half-updated state before you do an async function call.