Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <20010603055022.76428.qmail@web14503.mail.yahoo.com> Date: Sun, 3 Jun 2001 15:50:22 +1000 (EST) From: =?iso-8859-1?q?Danny=20Smith?= Subject: Re: CreateFiber() : number of fibers limited To: cygwin AT cygwin DOT com In-Reply-To: <20010603005305.A29081@systematik.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --- Dan Plimak wrote: > On Sat, Jun 02, 2001 at 01:52:05PM +0200, Holger Vogt wrote: > > Hi, > > > > the number of fibers scheduled with CreateFiber() seems to be limited to > > 53 in CYGWIN (62 after compiling with MINGW32). This is what I get from > > a test case with multiple CreateFiber() calls: > > > > [...] > > About the only thing that can cause CreateFiber() to fail is the inability > to allocate a stack for the fiber. Code generated by different compilers may > cause CreateFiber() to conk out after different amounts of stack > allocations (and different amounts of memory hereby allocated). > > Try lowering the stack size you're giving to CreateFiber(). Also, > GetLastError() is your friend. > > Anyhow, this most likely has nothing to do with Cygwin, but HTH. > > Cheers, > > -- danp > I too think the problem may be stack depletion- but it does have soemthing to do with gcc. The default stack reserve set by gcc's ld for pe targets is a whopping 0x02000000 (32 MB). By default, threads inherit the stack reserve of the calling thread, so that's 32 mb per thread. Likewise fibers default to stack reserve of the main thread. Try specifying stack reserve to a reasonable value - say 1mb - when you create fibers. Or set a different stacksize for process on command-line when building app. Danny _____________________________________________________________________________ http://messenger.yahoo.com.au - Yahoo! Messenger - Voice chat, mail alerts, stock quotes and favourite news and lots more! -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple