This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pthreads w/ cygwin32


Chris Provenzano wrote:

>Okay, is ther some flag I have to set to get a process to have more than 64
>threads? When I first tried it I just used a loop around CreateThread and
>at about 64 threads CreateThread returned an error. I tried it a few times
>just to be sure.

I didn't do anything special. The machines I've tested this on all have 32
or 64 MB RAM and lots of disk space for swap files, running either NT4 SP3,
Win95 OSR2, or Win98 RC0 (which just arrived this week). I typically use
_beginthread rather than CreateThread, which MS recommends you do when your
threads will make C library calls, but _beginthread calls CreateThread
internally, so it shouldn't affect how many threads you can make (actually
it might reduce it, since _beginthread allocates thread-specific data for
the C library's use). In my tests, _beginthread starts failing between 1100
and 1600 threads. Interestingly, if I run two such programs simultaneously,
they fail at around 600 to 800 threads each, which suggests an overall
system limit rather than a per-process limit.

Craig


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]