logoalt Hacker News

tcfhgjtoday at 1:07 AM1 replyview on HN

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


Replies

ibraheemdevtoday at 5:39 AM

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.