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
Furthermore, async rust can be run single threaded