ATOMIC_OPS(3) | Library Functions Manual | ATOMIC_OPS(3) |
atomic_ops
—
#include <sys/atomic.h>
atomic_ops
family of functions provide atomic memory
operations. There are 7 classes of atomic memory operations available:
Users of atomic memory operations should not make assumptions about how the memory access is performed (specifically, the width of the memory access). For this reason, applications making use of atomic memory operations should limit their use to regular memory. The results of using atomic memory operations on anything other than regular memory are undefined.
Users of atomic memory operations should take care to modify any given memory location either entirely with atomic operations or entirely with some other synchronization mechanism. Intermixing of atomic operations with other synchronization mechanisms for the same memory location results in undefined behavior.
Atomic operations are strongly ordered with respect to each other. The global visibility of other loads and stores before and after an atomic operation is undefined. Applications that require synchronization of loads and stores with respect to an atomic operation must use memory barriers. See membar_ops(3).
atomic_ops
functions first appeared in
NetBSD 5.0.
February 7, 2018 | NetBSD 9.2 |