Atomic compare exchange shouldn't require the failure ordering to be as strong as the success ordering #97418
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.
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 toAcqRel
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.
The text was updated successfully, but these errors were encountered: