Subj : Re: Number of Threads on XP To : comp.programming.threads From : Scott McPhillips [MVP] Date : Wed Feb 16 2005 12:58 am barbell wrote: > Hi, > > Is there any top limit on how many threads you should launch in an > application ? > > I am fully aware of the 'disadvantage' of having more than one thread on a > single CPU, but if the threads mostly are wating and not active all the > time - is it then a problem to have lets say....100 threads launched ? > > There is a practical limit, because each thread consumes some of the application's address space. The default stack size is 1 MB, so 100 threads take 100 MB of your application's 2 GB max addresses before they even do anything useful. That's not horrible, but obviously 1000 threads would be horrible. There is a more common practical limit at 64 threads. That is the max number you can wait on in WaitForMultipleObjects. -- Scott McPhillips [VC++ MVP] .