Created on 2010-08-25.00:00:00 last changed 161 months ago
Proposed resolution:
Change [atomics.types.operations.req] p. 23 as indicated:
[ Note: For example, t
The effect ofthe compare-and-exchange operationsatomic_compare_exchange_strong isif (memcmp(object, expected, sizeof(*object)) == 0) memcpy(object, &desired, sizeof(*object)); else memcpy(expected, object, sizeof(*object));— end note ] [..]
Change [atomics.types.operations.req] p. 25 as indicated:
25 Remark:
When a compare-and-exchange is in a loop, the weak version will yield better performance on some platforms. When a weak compare-and-exchange would require a loop and a strong one would not, the strong one is preferable. — end note ]The weak compare-and-exchange operations may fail spuriously, that is, return false while leaving the contents of memory pointed to by expected before the operation is the same that same as that of the object and the same as that of expected after the operationA weak compare-and-exchange operation may fail spuriously. That is, even when the contents of memory referred to by expected and object are equal, it may return false and store back to expected the same memory contents that were originally there.. [ Note: This spurious failure enables implementation of compare-and-exchange on a broader class of machines, e.g., loadlocked store-conditional machines. A consequence of spurious failure is that nearly all uses of weak compare-and-exchange will be in a loop.
[ 2011-02-24 Reflector discussion ]
Moved to Tentatively Ready after 6 votes.
[ 2011-02-15 Howard fixes numbering, Hans improves the wording ]
[ 2010-10-28 Daniel adds: ]
Duplicate issue 1475 also has a proposed resolution, but both issues are resolved with below proposed resolution.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2011-04-11 11:23:23 | admin | set | status: voting -> wp |
2011-03-05 15:24:28 | admin | set | status: ready -> voting |
2011-02-24 19:08:21 | admin | set | messages: + msg5537 |
2011-02-24 19:08:21 | admin | set | status: open -> ready |
2011-02-15 21:33:25 | admin | set | messages: + msg5489 |
2010-10-28 22:49:09 | admin | set | messages: + msg5179 |
2010-10-28 22:49:09 | admin | set | messages: + msg5178 |
2010-10-24 03:04:13 | admin | set | messages: + msg4960 |
2010-08-25 00:00:00 | admin | create |