www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/20/09:30:34

From: Cherniavsky Beni <cben AT crosswinds DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: multitasking/threading in DJGPP
Date: Tue, 20 Jun 2000 16:17:19 +0200
Organization: Technion
Lines: 24
Message-ID: <394F7CEF.C3B04F13@crosswinds.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000619173815 DOT 27216T-100000 AT is>
NNTP-Posting-Host: 132.68.54.8
Mime-Version: 1.0
X-Mailer: Mozilla 4.06 [en] (WinNT; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> > How much memory must I allocate per stacks just to be save?
> 
> There's no single answer to that question.  DJGPP programs get 512KB
> of stack by default, and that is enough for most programs, so if you
> want to be safe, use 512KB per thread.

Isn't there a way to check at run-time with what size of stack the
program is configured?  The idea is that the library should allocate
more stack per thread in programs needing much stack space.  I just
checked the FAQ - the two ways to change the stack size is setting
the global `_stklen' variable and STUBEDITing the executable - the
maximum of the two values is used.  It seems from the FAQ that in
the later case you wan't see it at runtime.  It would be nicer if
the startup code updated _stklen with the actual value it used.

Anyway a better solution might be to allow the stack size for the
thread as a parameter when creating a thread.
--
Beni Cherniavsky <cben AT crosswinds DOT net>
                 (also scben AT t2 in technion)
What's the exterior of a domain?
When one takes a bath we shout "Man overboard!".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019