I have an application that accepts work in a queue and then spins this work for independent threads. The number of threads is not massive, say, up to 100, but these are intensive tasks and can quickly increase processor performance up to 100%.
To get the job done as efficiently as possible: is it better for me to start more threads, when I need to do more work, and let the Java thread scheduler handle the work, or will it be smarter and manage the workload, will a processor below 100% speed me up?
The machine is dedicated to my java application.
EDIT:
Thanks for the fantastic contribution!
Tasks of varying complexity also include I / O operations, so having a pool with a small number of threads, say 4, will probably only work with a CPU of up to 20%. I have no way of knowing how many tasks the processor actually takes up to 100%.
My thought was that I should control the CPU through RMI and dynamically dial up and down, or I just don’t need to let the OS handle it.
source
share