Ah that Switchto thing looks really interesting. From my brief skimming it sounds like the actual biggest cost of context switching is not saving and restoring all the state, but deciding which thread to switch to.
The Switchto patch allows you to just tell Linux which thread to switch to, so it doesn't need to figure it out. Looks like they reduced the costs by ~20x. I wonder why it was never merged.
I guess my intuition was right then. I mean, async is still useful for WASM and microcontrollers, but for "I need to support 10000000 concurrent connections" (which is the usual motivation), it's a hack around poor OS APIs.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...