3 ms·
I think compare programing pattern(threads) to kernel async apis is a questionable comparation. The point of kernel async apis is not about letting programmers
by mmis1000 2y ago
I think compare programing pattern(threads) to kernel async apis is a questionable comparation.
The point of kernel async apis is not about letting programmers write system calls directly. It's about expose the actual async operations under the hook (it could be disk, be network, be anything outside of the computer case).
Those actions are never mean to be interleaved with cpu computation, because they are usually with ms level delay (which could be millions of cpu ticks). The kernel fakes these into sync calls by pause everything. But it isn't always the best idea to do these.
Let userland program decide what they want to do with the delay will be a way better idea. Even they eventually just invent blocking io calls again. They can still decide what operations are more relevant to itself instead of let the kernel guessing it.