osmemorybarrier(3) osx man page | unix.com

Man Page: osmemorybarrier

Operating Environment: osx

Section: 3

BARRIER(3)						   BSD Library Functions Manual 						BARRIER(3)

NAME
OSMemoryBarrier -- memory barrier to order loads and stores
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <libkern/OSAtomic.h> void OSMemoryBarrier(void);
DESCRIPTION
OSMemoryBarrier() 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 ALSO
atomic(3), spinlock(3) Darwin May 26, 2004 Darwin
Related Man Pages
osatomicor32(3) - mojave
osatomicadd32(3) - mojave
osatomicadd32barrier(3) - mojave
osatomicand32origbarrier(3) - mojave
membar_sync(3) - netbsd
Similar Topics in the Unix Linux Community
At A Glance Coloured Real Time Bargraph Generator...
Hearing Aid for OSX 10.12.x and greater.
Undeletable file
To print diamond asterisk pattern based on inputs
Syntax error in subtraction in Bash