From: Cherniavsky Beni 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: NNTP-Posting-Host: 132.68.54.8 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 (also scben AT t2 in technion) What's the exterior of a domain? When one takes a bath we shout "Man overboard!".