Hacker News new | ask | show | jobs
by tcfhgj 49 days ago
doesn't a async runtime have more knowledge about the tasks than the OS about the threads?
1 comments

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.