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

John Colvin john.loughran.colvin at gmail.com
Tue Nov 13 17:18:17 UTC 2018


On Tuesday, 13 November 2018 at 11:39:48 UTC, Kagamin wrote:
> On Monday, 12 November 2018 at 15:00:33 UTC, John Colvin wrote:
>> 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!
>
> Well, without acquire-release you can't meaningfully share data 
> - it simply doesn't reach another thread. Does it even count as 
> sharing? With immutable data you need to deliver data only 
> once, after that you can read it without synchronization.

What - precisely - do you mean by "without acquire-release you 
can't meaningfully share data - it simply doesn't reach another 
thread"?

How would the incrementing of the reference count in shared_ptr 
work then?


More information about the Digitalmars-d mailing list