Thin Lock Implementation

Jb jb at nowhere.com
Tue Aug 19 06:52:08 PDT 2008


"Bartosz Milewski" <bartosz at relisoft.com> wrote in message 
news:g8aeg7$h2h$1 at digitalmars.com...
>I posted some implementation details of Thin Lock in my blog, 
>http://bartoszmilewski.wordpress.com/ . I would appreciate comments.


Another thought I had is that when reading it is this.

For debuging purposes the compiler could do this.

When an object is created as never shared, rather than setting the thin lock 
to zero, you could instead set it to the current threadId.

Then the compiler could atomaticy add checks into the DBC code to make sure 
that the object is only ever accessed from the thread that created it.







More information about the Digitalmars-d mailing list