Subj : Re: Segmentation fault with multi threads - Stack limitation?! To : comp.programming.threads From : Torsten Robitzki Date : Mon Apr 11 2005 09:33 pm Hi Mike, Mike wrote: > Hi, > I wrote a simple program that basically do the following: > > > > The problem is as follow: > 1. If I run this program with NTHREADS==4 then it works fine > (thread_work do a lot of insertion and removal to the container). > 2. If I run it with NTHREADS==5 then I get segmentation fault while > doing insert to the container. It happens realy fast, meaning I don't > reach large number of insertion/removal... > 3. If I move the tdata array (which currenlty is on the stack of main) > and put it globally (out of main) it works fine again. I doubt that this is a stack limitation as you allocate just 5 list<>s (size of 4 pointers each, I guess). To confirm this, just comment out the calls to CreateThread() and WaitToThread() and you will get the same result if it's realy a stack overflow. regards Torsten .