3 ms·
I did find this interesting piece of information. > In a compute-bound application running on an N-processor machine, adding additional threads may improve thr
by eboyjr 13y ago
I did find this interesting piece of information.
> In a compute-bound application running on an N-processor machine, adding additional threads may improve throughput as the number of threads approaches N, but adding additional threads beyond N will do no good. Indeed, too many threads will even degrade performance because of the additional context switching overhead. The optimum size of a thread pool depends on the number of processors available and the nature of the tasks on the work queue. On an N-processor system for a work queue that will hold entirely compute-bound tasks, you will generally achieve maximum CPU utilization with a thread pool of N or N+1 threads.
From http://www.ibm.com/developerworks/library/j-jtp0730/index.html http://www.ibm.com/developerworks/library/j-jtp0730/index.ht...
- 1gn1t10n 13y agoThat's exactly what a threading library abstraction aims to do. For example the Intel TBB (Threading Building Blocks).