ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

For more information about the manual page format, see the manual page for manpages(5).



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 Pow-erPC, PowerPC,
     erPC, by creating a barrier.  All loads and stores executed in sequential program order before the bar-rier barrier
     rier 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 synchro-nization synchronization
     nization protocols as an alternative to the spinlock or queue/dequeue operations.  Note that this bar-rier barrier
     rier 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

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.