Created on 2008-10-17.00:00:00 last changed 169 months ago
Proposed resolution:
Change the note in [atomics.types.operations] paragraph 20 to:
[Note: The effect of the compare-and-exchange operations is
if (*object == *expected!memcmp(object,expected,sizeof(*object))) *object = desired; else *expected = *object;This may result in failed comparisons for values that compare equal if the underlying type has padding bits or alternate representations of the same value. -- end note]
[ 2009-10 Santa Cruz: ]
NAD EditorialResolved. Addressed by N2992.
[ Post Summit Anthony adds: ]
Recommend NAD. C++0x does have std::atomic<float>, and both compare_exchange_weak and compare_exchange_strong are well-defined in this case. Maybe change the note in [atomics.types.operations] paragraph 20 to:
[Note: The effect of the compare-and-exchange operations is
if (!memcmp(object,expected,sizeof(*object))) *object = desired; else *expected = *object;This may result in failed comparisons for values that compare equal if the underlying type has padding bits or alternate representations of the same value. -- end note]
[ Summit: ]
Move to open. Blocked until concepts for atomics are addressed.
Right now, C++0x doesn't have atomic<float>. We're thinking of adding the words to support it for TR2 (note: that would be slightly post-C++0x). If we need it, we could probably add the words.
Proposed resolutions: Using atomic<FP>::compare_exchange (weak or strong) should be either:
I propose Option 1 for C++0x for expediency. If someone wants to argue for Option 2, they need to say what exactly they want compare_exchange to mean in this case (IIRC, C++0x doesn't even assume IEEE 754).
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-12-05 14:14:49 | admin | set | status: nad editorial -> resolved |
2010-10-21 18:28:33 | admin | set | messages: + msg4390 |
2010-10-21 18:28:33 | admin | set | messages: + msg4389 |
2010-10-21 18:28:33 | admin | set | messages: + msg4388 |
2010-10-21 18:28:33 | admin | set | messages: + msg4387 |
2008-10-17 00:00:00 | admin | create |