Title
Incomplete memory order specifications
Status
nad
Section
[atomics.types.operations]
Submitter
INCITS

Created on 2010-08-25.00:00:00 last changed 170 months ago

Messages

Date: 2010-11-18.00:17:44

Proposed resolution:

  1. Change [atomics.types.operations] p. 9 as indicated:
    void atomic_store(volatile A* object, C desired);
    void atomic_store(A* object, C desired);
    void atomic_store_explicit(volatile A *object, C desired, memory_order order);
    void atomic_store_explicit(A* object, C desired, memory_order order);
    void A::store(C desired, memory_order order = memory_order_seq_cst) volatile;
    void A::store(C desired, memory_order order = memory_order_seq_cst);
    

    8 Requires: The order argument shall not be memory_order_consume, memory_order_acquire, nor memory_order_acq_rel.

    9 Effects: Atomically replaces the value pointed to by object or by this with the value of desired. Memory is affected according to the value of order. If the program does not specify an order, it shall be memory_order_seq_cst.

  2. Change [atomics.types.operations] p. 13 as indicated:
    C atomic_load(const volatile A* object);
    C atomic_load(const A* object);
    C atomic_load_explicit(const volatile A* object, memory_order);
    C atomic_load_explicit(const A* object, memory_order);
    C A::load(memory_order order = memory_order_seq_cst) const volatile;
    C A::load(memory_order order = memory_order_seq_cst) const;
    

    12 Requires: The order argument shall not be memory_order_release nor memory_order_acq_rel.

    13 Effects: Memory is affected according to the value of order. If the program does not specify an order, it shall be memory_order_seq_cst.

    14 Returns: Atomically returns the value pointed to by object or by this.

  3. Change [atomics.types.operations] p. 17 as indicated:
    C atomic_exchange(volatile A* object, C desired);
    C atomic_exchange(A* object, C desired);
    C atomic_exchange_explicit(volatile A* object, C desired, memory_order);
    C atomic_exchange_explicit(A* object, C desired, memory_order);
    C A::exchange(C desired, memory_order order = memory_order_seq_cst) volatile;
    C A::exchange(C desired, memory_order order = memory_order_seq_cst);
    

    17 Effects: Atomically replaces the value pointed to by object or by this with desired. Memory is affected according to the value of order. These operations are atomic read-modify-write operations (1.10). If the program does not specify an order, it shall be memory_order_seq_cst.

    18 Returns: Atomically returns the value pointed to by object or by this immediately before the effects.

  4. Change [atomics.types.operations] p. 20 as indicated:
    bool atomic_compare_exchange_weak(volatile A* object, C * expected, C desired);
    bool atomic_compare_exchange_weak(A* object, C * expected, C desired);
    bool atomic_compare_exchange_strong(volatile A* object, C * expected, C desired);
    bool atomic_compare_exchange_strong(A* object, C * expected, C desired);
    bool atomic_compare_exchange_weak_explicit(volatile A* object, C * expected, C desired,
      memory_order success, memory_order failure);
    bool atomic_compare_exchange_weak_explicit(A* object, C * expected, C desired,
      memory_order success, memory_order failure);
    bool atomic_compare_exchange_strong_explicit(volatile A* object, C * expected, C desired,
      memory_order success, memory_order failure);
    bool atomic_compare_exchange_strong_explicit(A* object, C * expected, C desired,
      memory_order success, memory_order failure);
    bool A::compare_exchange_weak(C & expected, C desired,
      memory_order success, memory_order failure) volatile;
    bool A::compare_exchange_weak(C & expected, C desired,
      memory_order success, memory_order failure);
    bool A::compare_exchange_strong(C & expected, C desired,
      memory_order success, memory_order failure) volatile;
    bool A::compare_exchange_strong(C & expected, C desired,
      memory_order success, memory_order failure);
    bool A::compare_exchange_weak(C & expected, C desired,
      memory_order order = memory_order_seq_cst) volatile;
    bool A::compare_exchange_weak(C & expected, C desired,
      memory_order order = memory_order_seq_cst);
    bool A::compare_exchange_strong(C & expected, C desired,
      memory_order order = memory_order_seq_cst) volatile;
    bool A::compare_exchange_strong(C & expected, C desired,
      memory_order order = memory_order_seq_cst);
    

    19 Requires: The failure argument shall not be memory_order_release nor memory_order_acq_rel. The failure argument shall be no stronger than the success argument.

    20 Effects: Atomically, compares the contents of the memory pointed to by object or by this for equality with that in expected, and if true, replaces the contents of the memory pointed to by object or by this with that in desired, and if false, updates the contents of the memory in expected with the contents of the memory pointed to by object or by this. Further, if the comparison is true, memory is affected according to the value of success, and if the comparison is false, memory is affected according to the value of failure. When only one memory_order argument is supplied, the value of success is order, and the value of failure is order except that a value of memory_order_acq_rel shall be replaced by the value memory_order_acquire and a value of memory_order_release shall be replaced by the value memory_order_relaxed. If the program does not specify an order, it shall be memory_order_seq_cst. If the operation returns true, these operations are atomic read-modify-write operations (1.10). Otherwise, these operations are atomic load operations.

    [..]

Date: 2010-11-29.00:35:20

[ 2010 Batavia ]

The Concurrency subgroup reviewed this, and deemed it NAD according to [atomics.types.operations] paragraph 2, bullet 4.

The working paper is correct as written.

Date: 2010-10-28.22:47:26

Addresses US-172

As of [atomics.types.operations] p. 9, 13, 17, 20:

The order specifications are incomplete because the non-_explicit functions do not have such parameters.

Add a new sentence: "If the program does not specify an order, it shall be memory_order_seq_cst." Or perhaps: "The non-_explicit non-member functions shall affect memory as though they were _explicit with memory_order_seq_cst."

History
Date User Action Args
2010-11-18 00:17:44adminsetmessages: + msg5376
2010-11-18 00:17:44adminsetstatus: open -> nad
2010-10-28 22:47:26adminsetmessages: + msg5177
2010-10-24 03:04:13adminsetmessages: + msg4959
2010-08-25 00:00:00admincreate