Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/atomic.9
Show All 16 Lines | |||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 18, 2019 | .Dd February 24, 2021 | ||||
.Dt ATOMIC 9 | .Dt ATOMIC 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm atomic_add , | .Nm atomic_add , | ||||
.Nm atomic_clear , | .Nm atomic_clear , | ||||
.Nm atomic_cmpset , | .Nm atomic_cmpset , | ||||
.Nm atomic_fcmpset , | .Nm atomic_fcmpset , | ||||
.Nm atomic_fetchadd , | .Nm atomic_fetchadd , | ||||
.Nm atomic_interrupt_fence , | |||||
rlibby: Comma? | |||||
.Nm atomic_load , | .Nm atomic_load , | ||||
.Nm atomic_readandclear , | .Nm atomic_readandclear , | ||||
.Nm atomic_set , | .Nm atomic_set , | ||||
.Nm atomic_subtract , | .Nm atomic_subtract , | ||||
.Nm atomic_store , | .Nm atomic_store , | ||||
.Nm atomic_thread_fence | .Nm atomic_thread_fence | ||||
.Nd atomic operations | .Nd atomic operations | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Show All 12 Lines | |||||
.Ft int | .Ft int | ||||
.Fo atomic_fcmpset_[acq_|rel_]<type> | .Fo atomic_fcmpset_[acq_|rel_]<type> | ||||
.Fa "volatile <type> *dst" | .Fa "volatile <type> *dst" | ||||
.Fa "<type> *old" | .Fa "<type> *old" | ||||
.Fa "<type> new" | .Fa "<type> new" | ||||
.Fc | .Fc | ||||
.Ft <type> | .Ft <type> | ||||
.Fn atomic_fetchadd_<type> "volatile <type> *p" "<type> v" | .Fn atomic_fetchadd_<type> "volatile <type> *p" "<type> v" | ||||
.Ft void | |||||
.Fn atomic_interrupt_fence "void" | |||||
.Ft <type> | .Ft <type> | ||||
.Fn atomic_load_[acq_]<type> "volatile <type> *p" | .Fn atomic_load_[acq_]<type> "volatile <type> *p" | ||||
.Ft <type> | .Ft <type> | ||||
.Fn atomic_readandclear_<type> "volatile <type> *p" | .Fn atomic_readandclear_<type> "volatile <type> *p" | ||||
.Ft void | .Ft void | ||||
.Fn atomic_set_[acq_|rel_]<type> "volatile <type> *p" "<type> v" | .Fn atomic_set_[acq_|rel_]<type> "volatile <type> *p" "<type> v" | ||||
.Ft void | .Ft void | ||||
.Fn atomic_subtract_[acq_|rel_]<type> "volatile <type> *p" "<type> v" | .Fn atomic_subtract_[acq_|rel_]<type> "volatile <type> *p" "<type> v" | ||||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | |||||
stores. | stores. | ||||
Essentially, this is why fences are two-way barriers. | Essentially, this is why fences are two-way barriers. | ||||
.Pp | .Pp | ||||
Although fences impose more restrictive ordering than acquire loads and | Although fences impose more restrictive ordering than acquire loads and | ||||
release stores, by separating access from ordering, they can sometimes | release stores, by separating access from ordering, they can sometimes | ||||
facilitate more efficient implementations of synchronization primitives. | facilitate more efficient implementations of synchronization primitives. | ||||
For example, they can be used to avoid executing a memory barrier until a | For example, they can be used to avoid executing a memory barrier until a | ||||
memory access shows that some condition is satisfied. | memory access shows that some condition is satisfied. | ||||
.Ss Interrupt Fence Operations | |||||
The | |||||
.Fn atomic_interrupt_fence() | |||||
function establishes ordering between its call location and any interrupt | |||||
handler executing on the same CPU. | |||||
It is modeled after the similar C11 function | |||||
.Fn atomic_signal_fence() , | |||||
and adapted for the kernel environment. | |||||
Done Inline ActionsApologies in advance for nitpicking grammar, but since this is the man page (which by the way is excellent overall):
I think should be plural, like Thread Fence Operations is.
Suggestions:
Additionally my spell check wants "modelled" to have one L, but I think this is a regional thing and I'm not sure if we're consistent about that. rlibby: Apologies in advance for nitpicking grammar, but since this is the man page (which by the way… | |||||
.Ss Multiple Processors | .Ss Multiple Processors | ||||
In multiprocessor systems, the atomicity of the atomic operations on memory | In multiprocessor systems, the atomicity of the atomic operations on memory | ||||
depends on support for cache coherence in the underlying architecture. | depends on support for cache coherence in the underlying architecture. | ||||
In general, cache coherence on the default memory type, | In general, cache coherence on the default memory type, | ||||
.Dv VM_MEMATTR_DEFAULT , | .Dv VM_MEMATTR_DEFAULT , | ||||
is guaranteed by all architectures that are supported by | is guaranteed by all architectures that are supported by | ||||
.Fx . | .Fx . | ||||
For example, cache coherence is guaranteed on write-back memory by the | For example, cache coherence is guaranteed on write-back memory by the | ||||
▲ Show 20 Lines • Show All 301 Lines • Show Last 20 Lines |
Comma?