<div dir="ltr">maybe something likeĀ <a href="https://dlang.org/phobos/core_bitop.html#.volatileLoad">https://dlang.org/phobos/core_bitop.html#.volatileLoad</a> andĀ <a href="https://dlang.org/phobos/core_bitop.html#.volatileStore">https://dlang.org/phobos/core_bitop.html#.volatileStore</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 13, 2017 at 1:37 PM, Igor via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am converting a C code that uses this macro:<br>
<br>
#define CompletePastWritesBeforeFuture<wbr>Writes _WriteBarrier(); _mm_sfence()<br>
<br>
As far as I see core.atomic:atomicFence() is the equivalent of _mm_sfence() but I can't find what would be the equivalent of _WriteBarrier(). As far as I understand it is used just to tell the compiler it can't rearrange instructions during optimizations so subsequent memory writes happen before previous ones. Same for _ReadBarrier().<br>
</blockquote></div><br></div>