Skip to content

Commit 0404ed2

Browse files
committed
[intro.races] Clarify 'synchronization operation'.
Fixes CWG 2297.
1 parent 359cc0c commit 0404ed2

File tree

1 file changed

+24
-34
lines changed

1 file changed

+24
-34
lines changed

source/basic.tex

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4625,35 +4625,37 @@
46254625
memory location.
46264626

46274627
\pnum
4628-
The library defines a number of atomic operations\iref{atomics} and
4629-
operations on mutexes\iref{thread} that are specially identified as
4630-
synchronization operations. These operations play a special role in making
4631-
assignments in one thread visible to another. A synchronization operation on one
4632-
or more memory locations is either a consume operation, an acquire operation, a
4633-
release operation, or both an acquire and release operation. A synchronization
4634-
operation without an associated memory location is a fence and can be either an
4635-
acquire fence, a release fence, or both an acquire and release fence. In
4636-
addition, there are relaxed atomic operations, which are not synchronization
4637-
operations, and atomic read-modify-write operations, which have special
4638-
characteristics. \begin{note} For example, a call that acquires a mutex will
4628+
All modifications to a particular atomic object \placeholder{M} occur in some
4629+
particular total order, called the \defn{modification order} of \placeholder{M}.
4630+
\begin{note} There is a separate order for each
4631+
atomic object. There is no requirement that these can be combined into a single
4632+
total order for all objects. In general this will be impossible since different
4633+
threads may observe modifications to different objects in inconsistent orders.
4634+
\end{note}
4635+
4636+
\pnum
4637+
Certain library calls \defn{synchronize with} other library calls performed by
4638+
another thread.
4639+
Such calls are also known as
4640+
\defnx{synchronization operations}{synchronization operation}.
4641+
\begin{note} Except in the specified cases, reading a later value does not
4642+
necessarily ensure visibility as described below. Such a requirement would
4643+
sometimes interfere with efficient implementation. \end{note} \begin{note} The
4644+
specifications of the synchronization operations
4645+
(\ref{support.signal}, \ref{util.smartptr.atomic}, \ref{atomics.order},
4646+
\ref{atomics.fences}, \ref{thread}) define when one reads the value
4647+
written by another. For atomic objects, the definition is clear.
4648+
A call that acquires a mutex will
46394649
perform an acquire operation on the locations comprising the mutex.
46404650
Correspondingly, a call that releases the same mutex will perform a release
46414651
operation on those same locations. Informally, performing a release operation on
46424652
\placeholder{A} forces prior
46434653
\indextext{side effects}%
46444654
side effects on other memory locations to become visible
46454655
to other threads that later perform a consume or an acquire operation on
4646-
\placeholder{A}. ``Relaxed'' atomic operations are not synchronization operations even
4647-
though, like synchronization operations, they cannot contribute to data races.
4648-
\end{note}
4649-
4650-
\pnum
4651-
All modifications to a particular atomic object \placeholder{M} occur in some
4652-
particular total order, called the \defn{modification order} of \placeholder{M}.
4653-
\begin{note} There is a separate order for each
4654-
atomic object. There is no requirement that these can be combined into a single
4655-
total order for all objects. In general this will be impossible since different
4656-
threads may observe modifications to different objects in inconsistent orders.
4656+
\placeholder{A}. ``Relaxed'' atomic operations are not synchronization
4657+
operations even though, like synchronization operations, they cannot
4658+
contribute to data races.
46574659
\end{note}
46584660

46594661
\pnum
@@ -4669,18 +4671,6 @@
46694671
\item is an atomic read-modify-write operation.
46704672
\end{itemize}
46714673

4672-
\pnum
4673-
Certain library calls \defn{synchronize with} other library calls performed by
4674-
another thread. For example, an atomic store-release synchronizes with a
4675-
load-acquire that takes its value from the store\iref{atomics.order}.
4676-
\begin{note} Except in the specified cases, reading a later value does not
4677-
necessarily ensure visibility as described below. Such a requirement would
4678-
sometimes interfere with efficient implementation. \end{note} \begin{note} The
4679-
specifications of the synchronization operations define when one reads the value
4680-
written by another. For atomic objects, the definition is clear. All operations
4681-
on a given mutex occur in a single total order. Each mutex acquisition ``reads
4682-
the value written'' by the last mutex release. \end{note}
4683-
46844674
\pnum
46854675
An evaluation \placeholder{A} \defn{carries a dependency} to an evaluation \placeholder{B} if
46864676

0 commit comments

Comments
 (0)