3 ms·
This is not true for Rust. Await in rust builds a larger state machine from the former. It does no implicit thread or task spawns (unless the future you're awai
by conradludgate 3y ago
This is not true for Rust. Await in rust builds a larger state machine from the former. It does no implicit thread or task spawns (unless the future you're awaiting does them explicitly).
Furthermore, async rust can be run single threaded
- vc8f6vVV 3y agoWhat happens if I block a future in a single threaded runtime?
- conradludgate 3y agoThen you block the runtime? _aha you got me, threads and pre-emptive concurrency is better_. This is where you have a reasonable trade off. I have accepted that async gives me more control over my code. For that I have to accept that blocking can slow down the app. After running async rust in production for over 2 years now I've not seen any blocking tasks block the executor. Maybe I'm just good but my experience is that my colleagues who come from C# generally don't make these mistakes either