Compiler Support of Memory-Ordering Directives
Windows provides the MemoryBarrier() macro, which causes the compiler to emit memory-ordering instructions. OS X provides OSMemoryBarrier(), which provides the same functionality.
gcc and Solaris Studio support using inline assembly to generate memory-ordering instructions. For example, asm volatile ("mfence":::"memory") would insert an mfence instruction at the desired location in the code.
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.