Skip to content
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

Atomic compare exchange shouldn't require the failure ordering to be as strong as the success ordering #97418

Closed
m-ou-se opened this issue May 26, 2022 · 2 comments
Labels
A-concurrency Area: Concurrency A-intrinsics Area: Intrinsics T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented May 26, 2022

Right now, Rust does not support compare_exchange(a, b, Acquire, Release): we require the success ordering to be at least as strong as the failure ordering, which means we must upgrade the success ordering to AcqRel in this example.

C++ proposal P0418r2 argues this is unnecessary.

The restriction has been removed in C++17. We should consider doing the same in Rust.

@m-ou-se m-ou-se added A-concurrency Area: Concurrency T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-intrinsics Area: Intrinsics labels May 26, 2022
@tmiasko
Copy link
Contributor

tmiasko commented May 26, 2022

Duplicate of #68464.

@m-ou-se
Copy link
Member Author

m-ou-se commented May 26, 2022

Oh, thanks!

@m-ou-se m-ou-se closed this as completed May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Concurrency A-intrinsics Area: Intrinsics T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants