Chapter: Multicore Application Programming For Windows, Linux, and Oracle Solaris - Hand-Coded Synchronization and Sharing

| Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail |

Compiler Support of Memory-Ordering Directives

Windows provides the MemoryBarrier() macro, which causes the compiler to emit memory-ordering instructions.

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.


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail


Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.