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

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


On 29-05-2012 23:32, Andrei Alexandrescu wrote:
> On 5/29/12 1:35 AM, deadalnix wrote:
>> Le 29/05/2012 01:38, Alex Rønne Petersen a écrit :
>>> I should probably add that Java learned it long ago, and yet we adopted
>>> it anyway... blergh.
>>>
>>
>> That is what I was about to say. No point of doing D if it is to repeat
>> previously done errors.
>
> So what is the lesson Java learned, and how does it address
> multithreaded programming in wake of that lesson?
>
> Andrei

It learned that allowing locking on arbitrary objects makes controlling 
locking (and thus reducing the chance for deadlocks) impossible.

It goes against our TLS-by-default and message-passing concurrency design.

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


More information about the Digitalmars-d mailing list