Weaken needlessly restrictive orderings on Arc::*_count#95183
Weaken needlessly restrictive orderings on Arc::*_count#95183bors merged 1 commit intorust-lang:masterfrom
Arc::*_count#95183Conversation
|
(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.