delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/20/16:04:00

Message-Id: <200006202002.XAA00101@alpha.netvision.net.il>
Date: Tue, 20 Jun 2000 23:05:06 +0200
X-Mailer: Emacs 20.6 (via feedmail 8.1.emacs20_6 I) and Blat ver 1.8.5b
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
To: Cherniavsky Beni <cben AT crosswinds DOT net>
CC: djgpp AT delorie DOT com
In-reply-to: <394F7CEF.C3B04F13@crosswinds.net> (message from Cherniavsky Beni
on Tue, 20 Jun 2000 16:17:19 +0200)
Subject: Re: multitasking/threading in DJGPP
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000619173815 DOT 27216T-100000 AT is> <394F7CEF DOT C3B04F13 AT crosswinds DOT net>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Cherniavsky Beni <cben AT crosswinds DOT net>
> Newsgroups: comp.os.msdos.djgpp
> Date: Tue, 20 Jun 2000 16:17:19 +0200
> 
> Isn't there a way to check at run-time with what size of stack the
> program is configured?

Yes, there is: look at the value of _stklen.

> The idea is that the library should allocate
> more stack per thread in programs needing much stack space.

What library? the DJGPP standard library, libc.a?  I don't think it's
library's business to decide how much stack to allocate.  It doesn't
have enough information for that, not in the startup code anyway.

> It would be nicer if
> the startup code updated _stklen with the actual value it used.

It does; please try it and tell if it doesn't work for you.  (The
startup code in crt0.S clearly updates _stklen with the actual value.)

> Anyway a better solution might be to allow the stack size for the
> thread as a parameter when creating a thread.

That won't help: the stack of a DJGPP program is allocated in its
entirety during startup, and its size cannot be changed later.  So the
maximum stack size must be determined statically at compile time, or
changed by STUBEDIT.

- Raw text -


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