rustc_thread_pool: Make CoreLatch::set use SeqCst instead of AcqRel#155609
Open
cuviper wants to merge 1 commit intorust-lang:mainfrom
Open
rustc_thread_pool: Make CoreLatch::set use SeqCst instead of AcqRel#155609cuviper wants to merge 1 commit intorust-lang:mainfrom
CoreLatch::set use SeqCst instead of AcqRel#155609cuviper wants to merge 1 commit intorust-lang:mainfrom
Conversation
…Rel` Every other modification of this variable uses `SeqCst`, which is justified in the sleep README. This particular choice of `AcqRel` was not discussed during its addition in rayon-rs/rayon#746, nor rayon-rs/rfcs#5, so I suspect was simply an oversight from earlier development. We probably do want this to participate in the same sequential consistency. The only other ordering difference is `CoreLatch::probe`'s load with `Acquire`, which should be fine because this doesn't need consistency with the sleep counters. See also rayon-rs/rayon#1297. As I commented there, I think in practice this would be quite rare to cause any problems, but it *could* be a source of non-deterministic bugs on targets with weak memory ordering.
Collaborator
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Collaborator
|
Contributor
Contributor
|
⌛ Testing commit 29ccf67 with merge fc3f153... Workflow: https://github.com/rust-lang/rust/actions/runs/24771624835 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 22, 2026
rustc_thread_pool: Make `CoreLatch::set` use `SeqCst` instead of `AcqRel` Every other modification of this variable uses `SeqCst`, which is justified in the sleep README. This particular choice of `AcqRel` was not discussed during its addition in rayon-rs/rayon#746, nor rayon-rs/rfcs#5, so I suspect was simply an oversight from earlier development. We probably do want this to participate in the same sequential consistency. The only other ordering difference is `CoreLatch::probe`'s load with `Acquire`, which should be fine because this doesn't need consistency with the sleep counters. See also rayon-rs/rayon#1297. As I commented there, I think in practice this would be quite rare to cause any problems, but it *could* be a source of non-deterministic bugs on targets with weak memory ordering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every other modification of this variable uses
SeqCst, which is justified in the sleep README. This particular choice ofAcqRelwas not discussed during its addition in rayon-rs/rayon#746, nor rayon-rs/rfcs#5, so I suspect was simply an oversight from earlier development. We probably do want this to participate in the same sequential consistency.The only other ordering difference is
CoreLatch::probe's load withAcquire, which should be fine because this doesn't need consistency with the sleep counters.See also rayon-rs/rayon#1297. As I commented there, I think in practice this would be quite rare to cause any problems, but it could be a source of non-deterministic bugs on targets with weak memory ordering.