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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 30 11:25:51 PDT 2012


On 5/30/12 10:34 AM, Alex Rønne Petersen wrote:
> On 30-05-2012 19:22, Andrei Alexandrescu wrote:
>> On 5/30/12 10:20 AM, Martin Nowak wrote:
>>> On Wed, 30 May 2012 01:10:41 +0200, Andrei Alexandrescu
>>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>
>>>> On 5/29/12 4:06 PM, Alex Rønne Petersen wrote:
>>>>> Synchronized blocks are good because they
>>>>> operate on an implicit, hidden, global mutex. You can't screw up with
>>>>> that.
>>>>
>>>> I think there's quite some disconnect here. If there's any
>>>> anti-pattern in this discussion, it's operating on an implicit,
>>>> hidden, global mutex. Walter agreed to eliminate that from D, but
>>>> never got around to it.
>>>>
>>>
>>> They're not really global, it's one per synchronized block.
>>
>> That means global. They're terrible and should be eliminated from the
>> language.
>>
>>
>> Andrei
>
> So you do agree that explicit synchronization is better?

No. It's worse most of the time, and usefully more flexible sometimes.

Andrei


More information about the Digitalmars-d mailing list