zlacker

[parent] [thread] 4 comments
1. the_mi+(OP)[view] [source] 2024-01-23 13:18:41
Async makes awaiting things much easier than other primitives in the language. So for instance if you both need to wait for stuff to happen on a socket or some event happening, async select makes that super easy.

You can also keep async relatively local to a function that does these things and is itself blocking otherwise.

replies(1): >>ameliu+O1
2. ameliu+O1[view] [source] 2024-01-23 13:30:37
>>the_mi+(OP)
Yes, async is easier, but granularity of performance is a real downside. The CPU is a resource too, and needs to be managed more carefully than async can do. There's a reason why people stopped using cooperative multitasking like in Windows 3.1 ...
replies(1): >>the_mi+78
◧◩
3. the_mi+78[view] [source] [discussion] 2024-01-23 14:07:56
>>ameliu+O1
Sure, but that’s not really an argument for or against async but for or against different runtime policies.
replies(1): >>ameliu+wN
◧◩◪
4. ameliu+wN[view] [source] [discussion] 2024-01-23 16:56:26
>>the_mi+78
What good are "runtime policies" if you're in a single thread that you can't interrupt (which is what async is)?
replies(1): >>the_mi+a82
◧◩◪◨
5. the_mi+a82[view] [source] [discussion] 2024-01-23 22:54:08
>>ameliu+wN
Async is not really that in Rust. While it's true that a singular poll cannot be preempted, things like task::spawn schedule that on a multi threaded executor. So a lot of cases behave just like threads except you await them from somewhere else.
[go to top]