Skip to content

A release store operation synchronizes with an acquire load operation instead of the reverse #132892

Open
@xmh0511

Description

@xmh0511

Location

In the document park

Calls to park synchronize-with calls to unpark, meaning that memory operations performed before a call to unpark are made visible to the thread that consumes the token and returns from park.

In atomic ordering terms, unpark performs a Release operation and park performs the corresponding Acquire operation. Calls to unpark for the same thread form a release sequence.

Since the memory order in Rust is from C++, in C++ standard, [atomics.order] p2 says:

An atomic operation A that performs a release operation on an atomic object M synchronizes with an atomic operation B that performs an acquire operation on M and takes its value from any side effect in the release sequence headed by A.

Since unpark performs a Release operation and park performs the corresponding Acquire operation, by the definition of the wording synchronizes with, we should say

calls to unpark synchronize-with calls to park.

Summary

calls to unpark synchronize-with calls to park.

because a release store operation synchronize with an acquire load operation

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library 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