|
4625 | 4625 | memory location.
|
4626 | 4626 |
|
4627 | 4627 | \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 |
4639 | 4649 | perform an acquire operation on the locations comprising the mutex.
|
4640 | 4650 | Correspondingly, a call that releases the same mutex will perform a release
|
4641 | 4651 | operation on those same locations. Informally, performing a release operation on
|
4642 | 4652 | \placeholder{A} forces prior
|
4643 | 4653 | \indextext{side effects}%
|
4644 | 4654 | side effects on other memory locations to become visible
|
4645 | 4655 | 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. |
4657 | 4659 | \end{note}
|
4658 | 4660 |
|
4659 | 4661 | \pnum
|
|
4669 | 4671 | \item is an atomic read-modify-write operation.
|
4670 | 4672 | \end{itemize}
|
4671 | 4673 |
|
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 |
| - |
4684 | 4674 | \pnum
|
4685 | 4675 | An evaluation \placeholder{A} \defn{carries a dependency} to an evaluation \placeholder{B} if
|
4686 | 4676 |
|
|
0 commit comments