Using threads can significantly improve the performance due to more 'workers' to perform the job. However, I've taken tests and noticed that it's the first few threads that make the biggest performance impact.
How come the time becomes almost constant for large amount of threads, say 1000 and 2000 amount of threads?
Is it because that there isn't enough work to do so most of them go to sleep waiting for work to pop up?
EDIT: I made a multithreaded finder in C which simply works as the find command in bash. I took some time with different amount of threads (phread_create) and noticed that I get biggest performance impact by just creating a few threads. However, the time is almost the same with 40 threads and 600 threads. Why is that so?
Thanks