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

Regan Heath regan at netmail.co.nz
Fri Jun 1 05:22:59 PDT 2012


On Thu, 31 May 2012 19:35:50 +0100, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> On Thu, 31 May 2012 14:29:27 -0400, Andrei Alexandrescu  
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> On 5/31/12 7:01 AM, Regan Heath wrote:
>
>>> Sorry, I have no spare time to spare. You're getting free  
>>> ideas/thoughts
>>> from me, feel free to ignore them.
>>
>> Thanks. Let me know if I understand correctly that your idea boils down  
>> to "I don't like synchronized, let's deprecate it and get back to  
>> core.sync.mutex and recommend the private thingamaroo." In that case, I  
>> disagree. I believe synchronized has good merits that are being ignored.
>
> No, this is definitely *not* what we are saying.  The idea is that  
> synchronized(x) is still present, but what objects you can call this on,  
> and more importantly, *who* can do this is restricted.

Exactly.

> Nobody is advocating abandoning synchronized in favor of manual locks.   
> In fact, I think we all want to *avoid* manual locks as much as  
> possible.  It's all about controlling access.  If it comes down to "you  
> must use a private, error-prone mutex member in order to prevent  
> deadlocks," then I think we have room for improvement.

Indeed.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list