-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Atomic CAS with pad (#23, P0528R3) #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
60884ab
Atomic CAS with pad (#23, P0528R3)
AlexGuteniev edd535b
formatting
AlexGuteniev c3c6c1c
Address review comments
AlexGuteniev 00f0ce4
more review comments
AlexGuteniev 2b635e5
Disable for EDG too
AlexGuteniev facabae
Skip test for clang, also more interesting bits
AlexGuteniev c072791
TRANSITION, LLVM-46685
AlexGuteniev 2250eec
Improve TRANSITION comment
AlexGuteniev cec43ef
Don't use has_unique_object_representations_v
AlexGuteniev c6a7614
longer
AlexGuteniev de3b54d
centralize preprocessor
AlexGuteniev 979cac7
test cleanup
AlexGuteniev 56793a7
undef
AlexGuteniev dcdfa48
Update stl/inc/atomic
AlexGuteniev 97076e4
Update stl/inc/atomic
AlexGuteniev 1a3e44e
delete the remaining &
AlexGuteniev 465ebe1
Don't penalize normal atomics in debug mode
AlexGuteniev ccbf24b
non-chained
AlexGuteniev ef818b7
for
AlexGuteniev d9620b0
+zero case
AlexGuteniev 69eb997
clang format
AlexGuteniev 1662f1c
finish up zero case
AlexGuteniev 0a35a47
Review comments on non-lock-free case
AlexGuteniev 9d96b8e
-addressof
AlexGuteniev 00e7416
more sizes
AlexGuteniev 2c05e4f
missing macro wrap
AlexGuteniev 027e7b9
Merge remote-tracking branch 'origin/master' into cmpxchg
BillyONeal 1b75b4e
Fix compare_exchange when _Ty has a nontrivial default ctor using _St…
BillyONeal 76de2ad
Fix STL CR comments.
BillyONeal 5280628
Update tests/std/tests/P0528R3_cmpxchg_pad/test.cpp
BillyONeal c2feae9
Update stl/inc/atomic
BillyONeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| RUNALL_INCLUDE ..\usual_latest_matrix.lst |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm should we do this always even when not C++20? It seems a straight up correctness win in all modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also asking #1029 (comment) :-)
I agree on one hand, on the other, remember atomic constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The atomic constructor situation is different because it had "static initialization order fiasco" effects not present here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I can imagine other ways, like defining a type with
=asmemcpyand==asmemcmp, thus effectively making its padding bits participate in value. I think old Standard explicitly specifies bitwise CAS instead of leaving out this case undefined.(Sure that's not a normal use case problem, but neither is this whole feature)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(if the decision is made towards exposing in pre-C++20, be sure to replace
constexprwith_CONSTEXPR_IF)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
I'm OK with leaving it '20 only.