← Back to context

Comment by tcfhgj

12 hours ago

doesn't a async runtime have more knowledge about the tasks than the OS about the threads?

Not the runtime per se, but cooperative scheduling has the advantage that tasks do not yield at adverse code points, e.g., right before giving up a lock, or performing an I/O request. Of course the lack of preemption has it's own downsides, but with thread-per-request you tend to run into tail latency issues much earlier than context switching overhead.