Sharing in D

Walter Bright newshound1 at digitalmars.com
Thu Jul 31 23:03:03 PDT 2008


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



More information about the Digitalmars-d mailing list