Reputation: 1824
In a windows process is there any limit for the threads to be used at a time. If so what is the maximum number of threads that can be used per process?
Upvotes: 32
Views: 49167
Reputation: 129524
The actual limit is determined by the amount of available memory in various ways. There is no limit of "you can't have more than this many" of threads or processes in Windows, but there are limits to how much memory you can use within the system, and when that runs out, you can't create more threads.
See this blog by Mark Russinovich: http://blogs.technet.com/b/markrussinovich/archive/2009/07/08/3261309.aspx
Upvotes: 7
Reputation: 98516
There is no limit that I know of, but there are two practical limits:
dwStackSize
in CreateThread
or option /STACK
in the linker command). If you use a 64-bits system this limit practically dissapears.Upvotes: 27