Query: barrier
OS: osx
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
BARRIER(3) BSD Library Functions Manual BARRIER(3)NAMEOSMemoryBarrier -- memory barrier to order loads and storesLIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <libkern/OSAtomic.h> void OSMemoryBarrier(void);DESCRIPTIONOSMemoryBarrier() strictly orders memory accesses in a weakly ordered memory model such as with PowerPC, by creating a barrier. All loads and stores executed in sequential program order before the barrier will complete with respect to the memory coherence mechanism, before any load or store executed after the barrier. Used with an atomic operation, the barrier can be used to create custom synchronization protocols as an alternative to the spinlock or queue/dequeue operations. Note that this barrier does not order uncached loads and stores. On a uniprocessor, the barrier operation is typically optimized into a nop.SEE ALSOatomic(3), spinlock(3) Darwin May 26, 2004 Darwin