Sharing in D
superdan
super at dan.org
Thu Jul 31 23:18:11 PDT 2008
Walter Bright Wrote:
> superdan wrote:
> > Walter Bright Wrote:
> >>> So "shared" will tell the compiler to automatically fence, etc?
> >> Yes.
> >
> > yech. so i write this:
> >
> > ++a; ++b; ++c;
> >
> > and very different code comes down the pike depending on a or b or c
> > being shared. not easy to clarify the code is correct. this ain't
> > cool.
>
>
> If conventional code were generated for i++, and i was accessed from
> multiple threads, the code is *broken*.
i grok that. my problem is that your shared doesn't help me with writing good code in that case. ++x is just wrong for shared x. i'd rather have it disabled or somethin'.
More information about the Digitalmars-d
mailing list