Title
Atomic load const qualification
Status
nad editorial
Section
[atomics]
Submitter
Alexander Chemeris

Created on 2008-08-24.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add const qualification to the pointer values of the atomic_address and atomic<T*> specializations. E.g.

typedef struct atomic_address {
   void store(const void*, memory_order = memory_order_seq_cst) volatile;
   void* exchange( const void*, memory_order = memory_order_seq_cst) volatile;
   bool compare_exchange( const void*&, const void*,
                          memory_order, memory_order) volatile;
   bool compare_exchange( const void*&, const void*,
                          memory_order = memory_order_seq_cst ) volatile;
   void* operator=(const void*) volatile;
} atomic_address;

void atomic_store(volatile atomic_address*, const void*);
void atomic_store_explicit(volatile atomic_address*, const void*,
                          memory_order);
void* atomic_exchange(volatile atomic_address*, const void*);
void* atomic_exchange_explicit(volatile atomic_address*, const void*,
                              memory_order);
bool atomic_compare_exchange(volatile atomic_address*,
                            const void**, const void*);
bool atomic_compare_exchange_explicit(volatile atomic_address*,
                                     const void**, const void*,
                                     memory_order, memory_order);
Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

NAD Editorial. Solved by N2992.

Date: 2009-08-17.00:00:00

[ 2009-08-17 Handled by N2925. ]

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Lawrence will handle all issues relating to atomics in a single paper.

LWG will defer discussion on atomics until that paper appears.

Move to Open.

Date: 2010-10-21.18:28:33

[ Summit: ]

Move to review. Lawrence will first check with Peter whether the current examples are sufficient, or whether they need to be expanded to include all cases.

Date: 2008-08-24.00:00:00

The atomic_address type and atomic<T*> specialization provide atomic updates to pointers. However, the current specification requires that the types pointer be to non-const objects. This restriction is unnecessary and unintended.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg4166
2010-10-21 18:28:33adminsetmessages: + msg4165
2010-10-21 18:28:33adminsetmessages: + msg4164
2010-10-21 18:28:33adminsetmessages: + msg4163
2010-10-21 18:28:33adminsetmessages: + msg4162
2008-08-24 00:00:00admincreate