Thin Lock Implementation

Bartosz Milewski bartosz at relisoft.com
Tue Aug 19 12:42:52 PDT 2008


Aarti_pl wrote:
>  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)?
> 

This is the number I've found in the D runtime and I didn't question it 
(yet!). Thin lock has a lot of bits to spare--I made the recursion count 
ridiculously huge. Count can easily be cut down to 8 bits and all the 
rest could go towards the thread index if necessary. On a 64-bit 
machine, thread index could spill into the extra 32-bits. So we are are 
well prepared for the future.



More information about the Digitalmars-d mailing list