3 ms·
You're conflating two distinct concepts. Certainly, code rewriting to support continuation is a factor in both C#-style await and generator functions, but they
by barrkel 12y ago
You're conflating two distinct concepts.
Certainly, code rewriting to support continuation is a factor in both C#-style await and generator functions, but they are not the same thing.
Much of the motivation behind async I/O is to reduce the number of active threads blocked on I/O. Blocked threads means stack space consumed, kernel transitions, and potentially CPU contention if too many threads become runnable at once, and then start fighting over mutexes or cache.
In this way of looking at the world, you don't want to block for any I/O. That's what the GP is getting at.