Yet another strike against the current AA implementation

Sean Kelly sean at invisibleduck.org
Wed Apr 29 09:24:14 PDT 2009


Georg Wrede wrote:
> Andrei Alexandrescu wrote:
> 
>> You can't have a stack smaller than 16KB as far as I understand. I 
>> seem to recall the default stack size is much bigger.
> 
> Totally not having researched this... The page 
> http://www.unix.com/high-level-programming/34632-how-find-out-stack-size-occupied-process.html 
> 
> states that "Most Linux systems have no stack limits set" (didn't have 
> time to find a definitive reference, yet).

One thing I don't understand is how the OS can manage essentially 
unbounded stack growth in a multithreaded program with a flat address 
space.  Is it simply that the physical memory for each stack is mapped 
into the same virtual address space when a context switch occurs?  And 
if so, how does this work with multiple cores?  The only alternative I 
can think of would be to dedicate a virtual address range to each stack, 
which would set a definite upper bound on the stack size for each 
thread, and wasted/unused memory between stacks.



More information about the Digitalmars-d mailing list