-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
compiler_fence documentation is misleading #129189
Copy link
Copy link
Closed
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.T-opsemRelevant to the opsem teamRelevant to the opsem team
Metadata
Metadata
Assignees
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.T-opsemRelevant to the opsem teamRelevant to the opsem team
Type
Fields
Give feedbackNo fields configured for issues without a type.
The current docs for
compiler_fenceexplain that function in terms of reorderings:That's somewhat misleading. For good reasons, our
fencedocs quickly transition from "reordering" to "synchronization" terminology:compiler_fenceshould also be explained in terms of synchronizes-with, to avoid raising any false expectations. Specifically, compiler_fence is equivalent to C++atomic_signal_fence, and so its synchronization rules are very similar to those offenceexcept that synchronization only occurs between a thread and its signal handler, not across different threads.Cc @rust-lang/libs-api @rust-lang/opsem
Cc rust-lang/unsafe-code-guidelines#347 #54962