The library defines a number of atomic operations (
[atomics]) and
operations on mutexes (
Clause [thread]) that are specially identified as
synchronization operations
. These operations play a special role in making
assignments in one thread visible to another
. A synchronization operation on one
or more memory locations is either an acquire operation, a
release operation, or both an acquire and release operation
. A synchronization
operation without an associated memory location is a fence and can be either an
acquire fence, a release fence, or both an acquire and release fence
. In
addition, there are relaxed atomic operations, which are not synchronization
operations, and atomic read-modify-write operations, which have special
characteristics
. [
Note 3:
For example, a call that acquires a mutex will
perform an acquire operation on the locations comprising the mutex
. Correspondingly, a call that releases the same mutex will perform a release
operation on those same locations
. Informally, performing a release operation on
A forces prior
side effects on other memory locations to become visible
to other threads that later perform a consume or an acquire operation on
A. “Relaxed” atomic operations are not synchronization operations even
though, like synchronization operations, they cannot contribute to data races
. —
end note]