Mail Archives: djgpp/2000/06/20/09:30:34
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 -