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

Timon Gehr timon.gehr at gmx.ch
Mon Nov 12 18:39:02 UTC 2018


On 12.11.18 16:00, John Colvin wrote:
> On Monday, 12 November 2018 at 14:54:12 UTC, John Colvin wrote:
>> However, with relaxed memory ordering I'm now more convinced that this 
>> would break immutability, which in turn means that the oft-made 
>> statement "immutable data doesn't require synchronisation" isn't true.
> 
> The correct statement would be more like "reading immutable data doesn't 
> require synchronisation if the method of obtaining the reference to the 
> immutable data has at least acquire-release semantics". Which is 
> considerably less snappy and confidence inspiring haha!

Yes. More generally, I think implicit sharing of immutable data was a 
mistake. (All it does is to forbid thread-local immutable data -- a 
valid use case.)


More information about the Digitalmars-d mailing list