Thin Lock Implementation

Jb jb at nowhere.com
Tue Aug 19 06:40:02 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.
>
> And by the way, I put it on reddit too: 
> http://www.reddit.com/comments/6wmq4/thin_lock_implementation/ .

One thing that occurs to me is this probably wont work with threads the D 
runtime doesnt know about. For example interupt call backs. For real time 
audio you typicaly send a callback funciton pointer to the soundcard driver 
and then this is called from the soundcards interupt thread.

But the D runtime thread pool doesnt know about this thread.

What about OS callbacks? Do they always come in on a thread that D knows 
about? Im not sure tbh.

And if you want real time operation, pro audio, live video, ect.. then these 
callback threads have to remain invisible to the GC, so it cant pause them.. 
but you'd still need them visible in the global thread index.. or else your 
thin lock mechanism wont work.

Then again maybe you shouldnt use the inbuilt thin locks in such 
circumstances anyway.












More information about the Digitalmars-d mailing list