Does anyone know? And a bigger question is what happens when you encounter this maximum? Is this the same number with other Windows OSs such as Vista, XP etc.?
Each core can only run 1 thread at a time, i.e. hyperthreading is disabled. So, you can have a total maximum of 20 threads executing in parallel, one thread per CPU/core.
The maximum threads setting specifies the maximum number of simultaneous transactions that the Web Server can handle. The default value is greater of 128 or the number of processors in the system. Changes to this value can be used to throttle the server, minimizing latencies for the transactions that are performed.
The number of threads with the default stack size is approximately 2000 threads on a 32-bit system and 8000 billion on a 64-bit system.
The number of running threads per application instance is limited to 10 420. Reaching this limit can cause performance issues.
First I would advise reading this: http://blogs.msdn.com/oldnewthing/archive/2007/03/01/1775759.aspx
then http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx
To summarise, the limitation is normally stack space (which must be in contiguous blocks) and since every thread consumes this scattered about you rapidly run out of contiguous blocks. On 64 bit machines and operating systems this is much less of a problem.
Mitigation strategies exist but will only go so far (and rely on you not using much stack per thread)
As a rough guide:
You likely shouldn't need to create more than ten anyway (and if you really do need to you should know this information already)
The best answer I've heard when asking such questions is:
It doesn't matter, and if you find that it does matter, you need to rethink what you're doing so that it doesn't matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With