Annotation of src/lib/libc/atomic/membar_ops.3, Revision 1.3
1.3 ! wiz 1: .\" $NetBSD: membar_ops.3,v 1.2 2009/05/18 12:39:17 wiz Exp $
1.1 ad 2: .\"
3: .\" Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
4: .\" All rights reserved.
5: .\"
6: .\" This code is derived from software contributed to The NetBSD Foundation
7: .\" by Jason R. Thorpe.
8: .\"
9: .\" Redistribution and use in source and binary forms, with or without
10: .\" modification, are permitted provided that the following conditions
11: .\" are met:
12: .\" 1. Redistributions of source code must retain the above copyright
13: .\" notice, this list of conditions and the following disclaimer.
14: .\" 2. Redistributions in binary form must reproduce the above copyright
15: .\" notice, this list of conditions and the following disclaimer in the
16: .\" documentation and/or other materials provided with the distribution.
17: .\"
18: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28: .\" POSSIBILITY OF SUCH DAMAGE.
29: .\"
1.2 wiz 30: .Dd February 11, 2007
1.1 ad 31: .Dt MEMBAR_OPS 3
32: .Os
33: .Sh NAME
34: .Nm membar_ops ,
35: .Nm membar_enter ,
36: .Nm membar_exit ,
37: .Nm membar_producer ,
38: .Nm membar_consumer ,
39: .Nm membar_sync
40: .Nd memory access barrier operations
41: .\" .Sh LIBRARY
42: .\" .Lb libc
43: .Sh SYNOPSIS
44: .In sys/atomic.h
45: .\"
46: .Ft void
47: .Fn membar_enter "void"
48: .Ft void
49: .Fn membar_exit "void"
50: .Ft void
51: .Fn membar_producer "void"
52: .Ft void
53: .Fn membar_consumer "void"
54: .Ft void
55: .Fn membar_sync "void"
56: .Sh DESCRIPTION
57: The
58: .Nm membar_ops
59: family of functions provide memory access barrier operations necessary
60: for synchronization in multiprocessor execution environments that have
61: relaxed load and store order.
62: .Pp
63: .Bl -tag -width "mem"
64: .It Fn membar_enter
1.3 ! wiz 65: Any store preceding
1.1 ad 66: .Fn membar_enter
67: will reach global visibility before all loads and stores following it.
68: .Pp
69: .Fn membar_enter
70: is typically used in code that implements locking primitives to ensure
71: that a lock protects its data.
72: .It Fn membar_exit
73: All loads and stores preceding
74: .Fn membar_exit
75: will reach global visibility before any store that follows it.
76: .Pp
77: .Fn membar_exit
78: is typically used in code that implements locking primitives to ensure
79: that a lock protects its data.
80: .It Fn membar_producer
81: All stores preceding the memory barrier will reach global visibility
82: before any stores after the memory barrier reach global visibility.
83: .It Fn membar_consumer
84: All loads preceding the memory barrier will complete before any loads
85: after the memory barrier complete.
86: .It Fn membar_sync
87: All loads and stores preceding the memory barrier will complete and
88: reach global visibility before any loads and stores after the memory
89: barrier complete and reach global visibility.
90: .El
91: .Sh SEE ALSO
92: .Xr atomic_ops 3
93: .Sh HISTORY
94: The
95: .Nm membar_ops
96: functions first appeared in
97: .Nx 5.0 .
CVSweb <webmaster@jp.NetBSD.org>