News for hackers. Stuff that matters.
Re:You might want async in your project by conradludgate on Saturday September 09, 2023 @06:47PM (#37451071)
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

Re:You might want async in your project by vc8f6vVV on Sunday September 10, 2023 @02:16PM (#37458462)
What happens if I block a future in a single threaded runtime?
Re:You might want async in your project by conradludgate on Monday September 11, 2023 @05:31AM (#37464809)
Then 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