-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add a spin loop hint for Arc::downgrade #76649
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Will this affect performance? Or improve it somehow? |
It will hint to the proccessor that there will be a spin loop, using for example the Worst case, this boils down to a no-op and speed isn't affected. This stackoverflow answer provides some more reasoning on what it will do |
@Amanieu With your experience from parking_lot, do you have an opinion on this? |
That's not what that code does: it first spins with |
Oops, apparently I misread. Thanks! In that case: @bors r+ rollup |
This comment has been minimized.
This comment has been minimized.
Oh, can you first remove the merge commit by rebasing/squashing? @bors r- |
This comment has been minimized.
This comment has been minimized.
b58db1b
to
929f80e
Compare
Rebased |
@bors r+ rollup |
📌 Commit 929f80e has been approved by |
…as-schievink Rollup of 15 pull requests Successful merges: - rust-lang#76649 (Add a spin loop hint for Arc::downgrade) - rust-lang#77392 (add `insert` to `Option`) - rust-lang#77716 (Revert "Allow dynamic linking for iOS/tvOS targets.") - rust-lang#78109 (Check for exhaustion in RangeInclusive::contains and slicing) - rust-lang#78198 (Simplify assert terminator only if condition evaluates to expected value) - rust-lang#78243 (--test-args flag description) - rust-lang#78249 (improve const infer error) - rust-lang#78250 (Document inline-const) - rust-lang#78264 (Add regression test for issue-77475) - rust-lang#78274 (Update description of Empty Enum for accuracy) - rust-lang#78278 (move `visit_predicate` into `TypeVisitor`) - rust-lang#78292 (Loop instead of recursion) - rust-lang#78293 (Always store Rustdoc theme when it's changed) - rust-lang#78300 (Make codegen coverage_context optional, and check) - rust-lang#78307 (Revert "Set .llvmbc and .llvmcmd sections as allocatable") Failed merges: r? `@ghost`
Adds
hint::spin_loop()
to the case whereArc::downgrade
spins.