Thin Lock Implementation

Walter Bright newshound1 at digitalmars.com
Tue Aug 19 12:30:31 PDT 2008


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.



More information about the Digitalmars-d mailing list