This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-03-20


726. Atomic and non-atomic objects in the memory model

Section: 6.9.2  [intro.multithread]     Status: CD2     Submitter: Clark Nelson     Date: 30 September, 2008

[Voted into WP at October, 2009 meeting.]

In general, the description of the memory model is very careful to specify when the objects under discussion are atomic or non-atomic. However, there are a few cases where it could be clearer.

Proposed resolution (March, 2009):

  1. Modify 6.9.2 [intro.multithread] paragraph 5 as follows:

  2. All modifications to a particular atomic object M occur in some particular total order, called the modification order of M. If A and B are modifications of an atomic object M and A happens before (as defined below) B, then A shall precede B in the modification order of M, which is defined below. [Note: This states that the modification orders must respect happens before. —end note] [Note: There is a separate order for each scalar atomic object. There is no requirement that these can be combined into a single total order for all objects. In general this will be impossible since different threads may observe modifications to different variables in inconsistent orders. —end note]
  3. Modify 6.9.2 [intro.multithread] paragraph 7 as follows:

  4. Certain library calls synchronize with other library calls performed by another thread. In particular, an atomic operation A that performs a release operation on an atomic object M synchronizes with an atomic operation B that performs an acquire operation on M and reads a value written by any side effect in the release sequence headed by A...
  5. Modify 6.9.2 [intro.multithread] paragraph 12 as follows:

  6. A visible side effect A on an a scalar object or bit-field M with respect to a value computation B of M satisfies the conditions:

    The value of a non-atomic scalar object or bit-field M, as determined by evaluation B, shall be the value stored by the visible side effect A. [Note: If there is ambiguity about which side effect to a non-atomic object or bit-field is visible, then there is a data race, and the behavior is undefined. —end note] ...