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

Andrei Alexandrescu andrei at erdani.com
Fri Jan 29 15:56:27 PST 2010


Robert Jacques wrote:
> On Fri, 29 Jan 2010 18:03:15 -0500, Andrei Alexandrescu 
> <andrei at erdani.com> wrote:
>> 6. When defining an object of a synchronized of shared type, you still 
>> need to qualify it with "shared" in order to make it so. For example:
>>
>> synchronized class A { ... }
>> shared A a; // fine
>> A b;        // error
>>
>> (I'm not 100% sure about this.)
> 
> While I like the auto-documentation portion of this, this is 
> inconsistent with scope classes. It's also redundant, particularly when 
> we start naming classes ConcurrentQueue, etc. to differentiate them from 
> their local cousins.

It's not redundant at least in that case. The reader might see:

A b;

and think, cool, this is per-thread allocated.


Andrei



More information about the dmd-concurrency mailing list