This is out of control with Java. Planning is done by the OS and therefore outside the scope of the JVM.
It is very likely that the kernel will be restored by the OS when it waits for the IO to complete.
A simple "one thread per core / processor" tip is for intensive CPU operations. If you know that most of the time you expect I / O, you can create more threads than cores.
Also note that the included Hyper-Threading value is calculated by the number of available processors, so a quad-core processor with Hyper-Threading enabled will have 8 available processors (see also this question ).
source share