3 ms·
> But a million threads on one box imposes significant constraints on how active those threads can be. Wouldn't the same constraints be imposed on a million as
by ai-dev 5y ago
> But a million threads on one box imposes significant constraints on how active those threads can be.
Wouldn't the same constraints be imposed on a million async tasks? What allows async tasks to be more active than threads? Is it the scheduling model, the overhead of context switching, or something else?
EDIT: I reread and saw that you mentioned context switching. I guess my question would then be the same as here: https://news.ycombinator.com/item?id=29452759 https://news.ycombinator.com/item?id=29452759. Is the claim that the context switching overhead when due to I/O readiness the same true? I'm mostly thinking about network servers, where I think most? context switches would be due to I/O readiness.
- xxpor 5y agoIf nothing else, a green thread context switch is much cheaper than a real context switch because you don't have the security overhead of flushing caches/tlb/etc