by the_duke · 3y ago · 0 comments
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).
(When the kernel decides which thread gets to run it's doing the equivalent of an epoll call.)