]> git.saurik.com Git - apple/libc.git/blame - sys/barrier.3
Libc-498.1.5.tar.gz
[apple/libc.git] / sys / barrier.3
CommitLineData
59e0d9fe
A
1.Dd May 26, 2004
2.Dt BARRIER 3
3.Os Darwin
4.Sh NAME
5.Nm OSMemoryBarrier
6.Nd memory barrier to order loads and stores
7.Sh LIBRARY
8.Lb libc
9.Sh SYNOPSIS
10.In libkern/OSAtomic.h
11.Ft void
12.Fn OSMemoryBarrier "void"
13.Sh DESCRIPTION
14.Fn OSMemoryBarrier
15strictly orders memory accesses in a weakly ordered memory model such as with PowerPC,
16by creating a barrier. All loads and stores executed in sequential program order before
17the barrier will complete with respect to the memory coherence mechanism, before any
18load or store executed after the barrier. Used with an atomic operation, the barrier
19can be used to create custom synchronization protocols as an alternative to the
20spinlock or queue/dequeue operations. Note that this barrier does not order uncached loads
21and stores. On a uniprocessor, the barrier operation is typically optimized into a nop.
22.Sh SEE ALSO
23.Xr atomic 3 ,
224c7076 24.Xr spinlock 3