Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Do some versions of Windows 7 (32 or 64 bits) manage the number of threads that any specific process are creating? If so, is there a way to configure a maximum limit of threads on system (in the registry for example)?

share|improve this question
Is this a question for your own program? Or do you want to limit other programs on your system? – EBGreen Jun 21 '11 at 20:23
I want to limit the thread number that my windows handle. – Diogo Jun 21 '11 at 20:27
Nothing you can do about it then if you didn't write the program that is creating threads. – EBGreen Jun 21 '11 at 20:28
And just to be clear, even if there were a way to limit it, you would most likely just break the program that is trying to make a new thread. If the program was properly coded it would handle the failure to create the thread, but at best it means that the program would not be able to do whatever it was creating the tread to do. – EBGreen Jun 21 '11 at 20:31
up vote 2 down vote accepted

The OS does not explicitly limit the creation of threads. It is essentially controlled by resource constraints. If the OS has the resources the the process can create as many threads as it wants until there are no more resources.

share|improve this answer
In a 32-bit app running without the "large address aware" option, assuming the app has not overridden the default stack allocation, there is a derived limit of somewhat less than 2000 threads per process. This is because the default reserved stack size is 1 MiB, and the process user mode address space is 2 GiB. "Somewhat less" is because there is already some stuff in the address space just to support any simple program (so you don't have quite 2 GiB free in a new process, and what you do have isn't all in one contiguous chunk). – Jamie Hanrahan Oct 24 '15 at 18:29

The technical concept to achieve this is a Job which allows for Limits.

There's pretty much that can be limited, but not the threads (at the time answering the question).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.