6 .Nd memory barrier to order loads and stores
10 .In libkern/OSAtomic.h
12 .Fn OSMemoryBarrier "void"
15 strictly orders memory accesses in a weakly ordered memory model such as with PowerPC,
16 by creating a barrier. All loads and stores executed in sequential program order before
17 the barrier will complete with respect to the memory coherence mechanism, before any
18 load or store executed after the barrier. Used with an atomic operation, the barrier
19 can be used to create custom synchronization protocols as an alternative to the
20 spinlock or queue/dequeue operations. Note that this barrier does not order uncached loads
21 and stores. On a uniprocessor, the barrier operation is typically optimized into a nop.