[dmd-concurrency] shared arrays

Steve Schveighoffer schveiguy at yahoo.com
Thu Jan 14 11:35:39 PST 2010





----- 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



      


More information about the dmd-concurrency mailing list