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

Alex Rønne Petersen alex at lycus.org
Tue May 29 15:58:11 PDT 2012


On 30-05-2012 00:45, Andrei Alexandrescu wrote:
> On 5/29/12 2:57 PM, Alex Rønne Petersen wrote:
>> On 29-05-2012 23:33, Andrei Alexandrescu wrote:
>>> On 5/29/12 1:37 AM, deadalnix wrote:
>>>> I would say that breaking things here, with the right deprecation
>>>> process, is the way to go.
>>>
>>> So what should we use for mutex-based synchronization if we deprecate
>>> synchronized classes?
>>>
>>> Andrei
>>
>> core.sync.mutex
>
> That's worse.
>
> Andrei
>

I don't agree. Also, it is faster than object monitors. This was proven 
by David Simcha recently where he sped up GC allocations by some 40%-ish 
factor just by changing to a final class derived from core.sync.mutex. 
And no, that's not a bug in the monitor implementation. It's a 
limitation of the design.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list