Originally posted by Paul Sisco:
I agree completely! You should do some tests with thread pools using different numbers of threads. You will see performance improve up to a point, then performance will degrade as you add more threads. The job being performed by each thread is a big factor, so the right number of threads for best performance can be different for different systems.
Another thing to consider is whether you want new threads for each execution, or if you want the threads started once and they will pull from work from a queue.
It will be a fun exercise, and you will learn quite a bit from it.
Originally posted by Ulf Dittmer:
I'd be careful to make generalized statements like that. 130 threads is not an unreasonable number for a multi-core server.
Furthermore, we don't know what the threads are doing. There might be external circumstances that ensure that only a few of them are CPU-bound at any given time.