DIP 1024--Shared Atomics--Community Review Round 1

IGotD- nise at nise.com
Tue Oct 1 14:14:47 UTC 2019

On Tuesday, 1 October 2019 at 10:40:52 UTC, Mike Parker wrote:
>"This change will require using core.atomic or equivalent 
>functions to read and >write to shared memory objects. It will 
>prevent unintended, inadvertent non-use of >atomic access."

What if the type is complex (like a struct) outside what the ISA 
can handle? Usually this only applies for integers 8 - 128 bits 
depending on architecture, anything beyond that is out of reach 
unless you want to dig into Intel TSX which the shared attribute 
isn't suitable for.

Another thing that is left out are the effects of operator 

shared int s;

// What would this do? Atomically increment s or just atomically 
load s, add one
// and then atomically store s?
s = s + 1;
// Would this atomically increase s and return the value after 

More information about the Digitalmars-d mailing list