3 ms·
IO doesn't cause the whole CPU to be idle. It simply causes a context switch, which will allow another thread to do work.
by vemv 5y ago
IO doesn't cause the whole CPU to be idle. It simply causes a context switch, which will allow another thread to do work.
- kaba0 5y agoBut it might not come back to the thread that made the IO only “much” later when the IO call interrupts. So a given thread will spend more time than necessary inside the thread pool, stealing resources from other threads.
- btbuilder 5y agoIf you only have one thread per core it is possible there will be no runnable threads while there is still work in the queue. Other threads could be waiting for IO or already running.