4 ms·
Synchronous IO has always been more efficient. Anyone that thought otherwise doesn't understand how complicated context switches are in CPUs. The benefit of asy
by spullara 2y ago
Synchronous IO has always been more efficient. Anyone that thought otherwise doesn't understand how complicated context switches are in CPUs. The benefit of async io has always been handling tons of idle connections.
- wruza 2y agoAnyone that thought otherwise doesn't understand how complicated context switches are in CPUs That’s not true. I understand how context switches work down to tss records, but can’t immediately see why nonblock should be less efficient. Is it due to for-rw vs for-poll-rw? Doesn’t kqueue/iocp ought to solve that?
- nullindividual 2y agokqueue, like all non-io_uring implementations on Linux, are synchronous under the hood.
- dist1ll 2y agoYielding in a cooperatively multitasked runtime is not comparable to OS context switches between user threads. The former is very, very efficient.
- anonymoushn 2y agoYou can perform all the I/O you want with 0 context switches today in Linux. Why would performing more context switches (e.g. to call read(2)) speed things up?