-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weaken needlessly restrictive orderings on Arc::*_count
#95183
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @Amanieu |
In theory we could even make these |
Cloning an Arc increments the strong counter (and cloning a Weak the weak counter) with Relaxed ordering, so if we're going to clean up these unnecssary SeqCst orderings, we should probably just make them Relaxed. |
It looks like |
Not really a specific reason, it just seemed unnecessary, and one of the library teams goals cited recently was to remove needless
Relying on |
I think this change is fine to merge, we can leave the decision to switch to @bors r |
📌 Commit 7e93032 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e209e85): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Weaken needlessly restrictive orderings on Arc::*_count Follow up to rust-lang#95183 from this zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Why.20does.20Arc.3A.3Astrong_count.20use.20Acquire.20instead.20of.20Relaxed.3F/near/386213850 I'd like to use the strong_count for a lockless algorithm I'm writing, but I don't need acquire semantics so that's pointlessly restrictive on arm/risc-v.
Weaken needlessly restrictive orderings on Arc::*_count Follow up to rust-lang/rust#95183 from this zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Why.20does.20Arc.3A.3Astrong_count.20use.20Acquire.20instead.20of.20Relaxed.3F/near/386213850 I'd like to use the strong_count for a lockless algorithm I'm writing, but I don't need acquire semantics so that's pointlessly restrictive on arm/risc-v.
Weaken needlessly restrictive orderings on Arc::*_count Follow up to rust-lang/rust#95183 from this zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Why.20does.20Arc.3A.3Astrong_count.20use.20Acquire.20instead.20of.20Relaxed.3F/near/386213850 I'd like to use the strong_count for a lockless algorithm I'm writing, but I don't need acquire semantics so that's pointlessly restrictive on arm/risc-v.
Weaken needlessly restrictive orderings on Arc::*_count Follow up to rust-lang/rust#95183 from this zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Why.20does.20Arc.3A.3Astrong_count.20use.20Acquire.20instead.20of.20Relaxed.3F/near/386213850 I'd like to use the strong_count for a lockless algorithm I'm writing, but I don't need acquire semantics so that's pointlessly restrictive on arm/risc-v.
There is no apparent reason for these to be
SeqCst
. For reference, the Boost C implementation relies on acquire semantics.