Skip to content

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

Closed
@m-ou-se

Description

@m-ou-se

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyA-intrinsicsArea: IntrinsicsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions