|
4655 | 4655 | memory location.
|
4656 | 4656 |
|
4657 | 4657 | \pnum
|
4658 |
| -The library defines a number of atomic operations\iref{atomics} and |
4659 |
| -operations on mutexes\iref{thread} that are specially identified as |
4660 |
| -synchronization operations. These operations play a special role in making |
4661 |
| -assignments in one thread visible to another. A synchronization operation on one |
4662 |
| -or more memory locations is either a consume operation, an acquire operation, a |
4663 |
| -release operation, or both an acquire and release operation. A synchronization |
4664 |
| -operation without an associated memory location is a fence and can be either an |
4665 |
| -acquire fence, a release fence, or both an acquire and release fence. In |
4666 |
| -addition, there are relaxed atomic operations, which are not synchronization |
4667 |
| -operations, and atomic read-modify-write operations, which have special |
4668 |
| -characteristics. \begin{note} For example, a call that acquires a mutex will |
| 4658 | +All modifications to a particular atomic object \placeholder{M} occur in some |
| 4659 | +particular total order, called the \defn{modification order} of \placeholder{M}. |
| 4660 | +\begin{note} There is a separate order for each |
| 4661 | +atomic object. There is no requirement that these can be combined into a single |
| 4662 | +total order for all objects. In general this will be impossible since different |
| 4663 | +threads may observe modifications to different objects in inconsistent orders. |
| 4664 | +\end{note} |
| 4665 | + |
| 4666 | +\pnum |
| 4667 | +Certain library calls \defn{synchronize with} other library calls performed by |
| 4668 | +another thread. |
| 4669 | +Such calls are also known as |
| 4670 | +\defnx{synchronization operations}{synchronization operation}. |
| 4671 | +\begin{note} Except in the specified cases, reading a later value does not |
| 4672 | +necessarily ensure visibility as described below. Such a requirement would |
| 4673 | +sometimes interfere with efficient implementation. \end{note} \begin{note} The |
| 4674 | +specifications of the synchronization operations |
| 4675 | +(\ref{support.signal}, \ref{util.smartptr.atomic}, \ref{atomics.order}, |
| 4676 | +\ref{atomics.fences}, \ref{thread}) define when one reads the value |
| 4677 | +written by another. For atomic objects, the definition is clear. |
| 4678 | +A call that acquires a mutex will |
4669 | 4679 | perform an acquire operation on the locations comprising the mutex.
|
4670 | 4680 | Correspondingly, a call that releases the same mutex will perform a release
|
4671 | 4681 | operation on those same locations. Informally, performing a release operation on
|
4672 | 4682 | \placeholder{A} forces prior
|
4673 | 4683 | \indextext{side effects}%
|
4674 | 4684 | side effects on other memory locations to become visible
|
4675 | 4685 | to other threads that later perform a consume or an acquire operation on
|
4676 |
| -\placeholder{A}. ``Relaxed'' atomic operations are not synchronization operations even |
4677 |
| -though, like synchronization operations, they cannot contribute to data races. |
4678 |
| -\end{note} |
4679 |
| - |
4680 |
| -\pnum |
4681 |
| -All modifications to a particular atomic object \placeholder{M} occur in some |
4682 |
| -particular total order, called the \defn{modification order} of \placeholder{M}. |
4683 |
| -\begin{note} There is a separate order for each |
4684 |
| -atomic object. There is no requirement that these can be combined into a single |
4685 |
| -total order for all objects. In general this will be impossible since different |
4686 |
| -threads may observe modifications to different objects in inconsistent orders. |
| 4686 | +\placeholder{A}. ``Relaxed'' atomic operations are not synchronization |
| 4687 | +operations even though, like synchronization operations, they cannot |
| 4688 | +contribute to data races. |
4687 | 4689 | \end{note}
|
4688 | 4690 |
|
4689 | 4691 | \pnum
|
|
4699 | 4701 | \item is an atomic read-modify-write operation.
|
4700 | 4702 | \end{itemize}
|
4701 | 4703 |
|
4702 |
| -\pnum |
4703 |
| -Certain library calls \defn{synchronize with} other library calls performed by |
4704 |
| -another thread. For example, an atomic store-release synchronizes with a |
4705 |
| -load-acquire that takes its value from the store\iref{atomics.order}. |
4706 |
| -\begin{note} Except in the specified cases, reading a later value does not |
4707 |
| -necessarily ensure visibility as described below. Such a requirement would |
4708 |
| -sometimes interfere with efficient implementation. \end{note} \begin{note} The |
4709 |
| -specifications of the synchronization operations define when one reads the value |
4710 |
| -written by another. For atomic objects, the definition is clear. All operations |
4711 |
| -on a given mutex occur in a single total order. Each mutex acquisition ``reads |
4712 |
| -the value written'' by the last mutex release. \end{note} |
4713 |
| - |
4714 | 4704 | \pnum
|
4715 | 4705 | An evaluation \placeholder{A} \defn{carries a dependency} to an evaluation \placeholder{B} if
|
4716 | 4706 |
|
|
0 commit comments