4 ms·
I don't quite follow your argument there. This is unrelated to kernel threading. If you have 1 thread handling 1000 requests with some async io mechanism (epo
by the_duke 4y ago
I don't quite follow your argument there.
This is unrelated to kernel threading.
If you have 1 thread handling 1000 requests with some async io mechanism (epoll, io_uring, ...) ,instead of 1000 threads each handling one request, there are much fewer threads fighting over CPU cores and the 1 thread can stay active much longer, hence reducing the amount of context switches.
Especially with a mechanism like io_uring, which helps minimize syscalls (and hence switching to kernel threads).
- otabdeveloper4 4y agoFalse. Both epoll and thread switching use the exact same kernel scheduling mechanisms under the hood. (When the kernel decides which thread gets to run it's doing the equivalent of an epoll call.)