A breach of immutability due to memory implicit conversions to immutable without synchronisation, maybe??

John Colvin john.loughran.colvin at gmail.com
Mon Nov 12 13:17:09 UTC 2018


On Monday, 12 November 2018 at 11:54:36 UTC, Kagamin wrote:
> On Monday, 12 November 2018 at 09:19:26 UTC, John Colvin wrote:
>> The MODIFY line changes the value where the pointer looks. I'm 
>> asking whether it's possible that either READ happens before 
>> MODIFY (which would be v. bad). Using two reads instead of one 
>> was just to turn the (potential) ordering bug in to a 
>> (potential) breach of immutability.
>
> For that you will need READ to happen before atomicLoad (in 
> which case it will just dereference null pointer?) or MODIFY to 
> happen after atomicStore?

The first one is definitely not allowed, I'm not worried about 
that. But is it actually forbidden for the MODIFY to happen after 
atomicStore?


More information about the Digitalmars-d mailing list