[dmd-concurrency] shared arrays

Andrei Alexandrescu andrei at erdani.com
Thu Jan 14 11:53:50 PST 2010


I see. We definitely need to make array appending a template that passes 
control to a non-template later. The litmus test is, can I 
copy-construct objects of type T? For this particular type that should 
be allowed, but not for a type that e.g. contains a shared long or array.

Andrei

Steve Schveighoffer wrote:
> 
> 
> 
> ----- Original Message ----
>> From: Andrei Alexandrescu <andrei at erdani.com>
>> To: Discuss the concurrency model(s) for D <dmd-concurrency at puremagic.com>
>> Sent: Thu, January 14, 2010 2:22:42 PM
>> Subject: Re: [dmd-concurrency] shared arrays
>>
>> Steve Schveighoffer wrote:
>>> The one problem I still have no idea how to solve is the "partially shared" 
>> element type as T is:
>>> struct T
>>> {
>>>    shared int x;
>>>    int y;
>>> }
>>>
>>> -Steve
>> What examples illustrates the problem? Thanks!
> 
> T[] x;
> x ~= T(0, 1);
> 
> This calls the runtime's _d_arrayappendT, which is given the typeinfo for T[].  Unless there is some way for the runtime to figure out that T has some shared data in it, and where inside the T that shared data is (so it can put the appropriate checks around it), I don't see how the runtime can cope with this properly.
> 
> -Steve
> 
> 
> 
>       
> _______________________________________________
> dmd-concurrency mailing list
> dmd-concurrency at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-concurrency


More information about the dmd-concurrency mailing list