2 ms·
Coroutines via user-mode stack-switching worked just fine for decades. Async/await is really only needed on limited runtime environments like Javascript or WASM
by flohofwoe 2y ago
Coroutines via user-mode stack-switching worked just fine for decades. Async/await is really only needed on limited runtime environments like Javascript or WASM where stack switching isn't an option (and at the cost that the compiler needs to turn sequential code into a switch-case state machine under the hood, which then introduces all sorts of problems, from 'function coloring' to requiring special support in debuggers).