synchronized (this[.classinfo]) in druntime and phobos

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 29 16:04:43 PDT 2012


On 5/29/12 3:56 PM, Alex Rønne Petersen wrote:
> A mutex can be stored privately.

It can, but that doesn't mean it will.

> Any object can be locked on, meaning no
> lock is effectively protected or private or... anything.

To paraphrase you, "An object can be stored privately".

> It encourages
> shared locks, which is seriously the worst deadlock inducing
> anti-pattern to have ever manifested in multithreaded programming.

I'll ignore the hyperbole and continued posturing. Please understand it 
does absolutely nothing in carrying your point. A technical question I 
have is - what are shared locks, and what are superior alternatives to them?


Andrei




More information about the Digitalmars-d mailing list