Thin Lock Implementation

Steven Schveighoffer schveiguy at
Tue Aug 19 07:41:31 PDT 2008

"Aarti_pl" wrote
> Bartosz Milewski pisze:
>> I posted some implementation details of Thin Lock in my blog, 
>> . I would appreciate comments.
>> And by the way, I put it on reddit too: 
>> .
>> Bartosz
> Well, I am definitely no concurrency expert, but one questions bothers me 
> a bit.
> From your article it seems that there will be limit of 2046 threads for 
> program (11 bits, one based).
> Isn't it too small number, taking into account multi core processors which 
> will emerge (able to start much more threads than currently), and 
> applications like web servers (which serves a lot of concurrent 
> connections)?

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).


More information about the Digitalmars-d mailing list