[dmd-concurrency] shared arrays

Andrei Alexandrescu andrei at erdani.com
Thu Jan 14 11:58:24 PST 2010


Steve Schveighoffer wrote:
> or these?
> 
> b.dup; T t; b ~= t; b ~= a;
> 
> But really, I don't understand why it's ok to copy i.e. a
> shared(char)[] where half of it might have changed, but it's not OK
> to copy an array of large types.

The array does not enforce any particular relationship between its members.

> Does this also mean that shared(long) isn't usable?  Isn't that a bit
> limiting?

It is, but we can't do it without losing the no-tearing guarantee.

Standard answer: use message passing :o).


Andrei



More information about the dmd-concurrency mailing list