Compiler magic for preventing memory access re-ordering _by the compiler_ (keywords: memory model, compiler optimisations, memory order)

Michael V. Franklin slavo5150 at yahoo.com
Mon Nov 6 05:55:48 UTC 2017


On Monday, 6 November 2017 at 05:54:00 UTC, Michael V. Franklin 
wrote:
> On Monday, 6 November 2017 at 03:40:23 UTC, Cecil Ward wrote:
>>
>> Is there a magic visible sign (or even one needed) in the D 
>> language that tells D _compilers_ not to move certain types of 
>> memory load / store operations forwards or backwards relative 
>> to other operations when optimising the code so that the order 
>> in the actual generated code varies from the source code order?
>
> You may be looking for volatileLoad/Store:  
> https://dlang.org/changelog/2.067.0.html#volatile-load-store

Also https://dlang.org/phobos/core_bitop.html#.volatileLoad

Mike




More information about the Digitalmars-d-learn mailing list