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

Kagamin spam at here.lot
Wed Nov 14 08:38:55 UTC 2018


On Tuesday, 13 November 2018 at 17:18:17 UTC, John Colvin wrote:
> What - precisely - do you mean by "without acquire-release you 
> can't meaningfully share data - it simply doesn't reach another 
> thread"?

The data simply remains in processor cache.

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

You mean relaxed order? Looks like llvm has better description 
for that http://llvm.org/docs/Atomics.html#monotonic it's a 
synchronization, just weak - synchronizes only one variable, not 
the entire cache, and why you need full synchronization on 
decrement - because you may need to run the destructor, which 
needs the latest state of the object and everything it references.


More information about the Digitalmars-d mailing list