Thin Lock Implementation

BCS ao at pathlink.com
Tue Aug 19 13:22:16 PDT 2008


Reply to Walter,

> Sascha Katzner wrote:
> 
>> Steven Schveighoffer wrote:
>> 
>>> On a 32-bit system, the amount of addressable memory space and the
>>> stack size are the factors that limit the number of threads.  For
>>> example, if addressable space is 2GB, and each thread has a 1MB
>>> stack, that's 2000 threads max (this is the typical situation for
>>> Windows).
>>> 
>> Not exactly right, since the stack is organized in 4kb pages and
>> these pages are not initialized until they are first used they
>> usually require a lot less than 1mb.
>> 
> The memory isn't committed until it is used, but the address space is.
> You cannot move the stack if it exceeds its preallocated address space
> allotment.
> 

Must the stack be contiguous? Could you, on a stack overflow, heap allocate 
a new chunk and put in a frame that gets back to the last segment?





More information about the Digitalmars-d mailing list