[dmd-concurrency] shared arrays, real, shared classes, synchronized classes
Andrei Alexandrescu
andrei at erdani.com
Sun Jan 31 22:49:13 PST 2010
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).
Andrei
More information about the dmd-concurrency
mailing list