[dmd-concurrency] shared arrays, real, shared classes, synchronized classes

Sean Kelly sean at invisibleduck.org
Sun Jan 31 23:01:51 PST 2010


On Jan 31, 2010, at 10:49 PM, Andrei Alexandrescu wrote:

> Sean Kelly wrote:
>>> 4. The "synchronized" attribute is hoisted at class level:
>>> synchronized class A { ... }
>>> That means each and every method of that class is synchronized.
>> Much clearer, and it neatly eliminates all the weirdness with shared
>> and synchronized methods interacting.  I assume these classes can
>> still contain explicitly shared data?  Is there any way around
>> locking for get() { return shared_x; } ?
> 
> The compiler is able to eliminate locks through analysis. But I'm sure you know a barrier is still needed :o).

Okay, that's what I figured.  Just wanted to verify that this was possible :-)


More information about the dmd-concurrency mailing list