-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue for hint::spin_loop (renamed sync::atomic::spin_loop_hint) #55002
Comments
Move spin_loop_hint to core::hint module As mentioned in rust-lang#55002. The new name is kept unstable to decide whether the function should have `_hint` in its name.
Move spin_loop_hint to core::hint module As mentioned in rust-lang#55002. The new name is kept unstable to decide whether the function should have `_hint` in its name.
Move spin_loop_hint to core::hint module As mentioned in rust-lang#55002. The new name is kept unstable to decide whether the function should have `_hint` in its name.
Move spin_loop_hint to core::hint module As mentioned in #55002. The new name is kept unstable to decide whether the function should have `_hint` in its name.
|
Are you sure? The target spec for that sets the cpu to Yonah, which has SSE2. |
@rkruppe indeed, that's fixed, I've closed that issue. |
Note that this isn't a tracking issue for the function itself; it's already stable and any bugs/qualms are reported separately. This is just for the renaming of it. |
If this routine is moved to std::hint then the documentation of std::hint should be updated as well. It currently reads:
Pause instruction is a hint to the CPU, not to the compiler. |
I agree; it should be changed to "compiler and/or CPU". |
It's been a few years since this landed, so in an effort to un-kitchen-sink the
@rfcbot fcp merge This proposes stabilizing the following API: pub mod hint {
pub fn spin_loop();
} And deprecating the following API: pub mod sync {
pub mod atomic {
pub fn spin_loop_hint();
}
} |
Team member @KodrAus has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Assuming LLVM generates the x86
it disassembles to a |
One (not required for stabilisation) thing that may also useful to mention is that Essentially, there are times where you can't outright halt the CPU until the next interrupt and you also have to wait for a condition to be met, and because you are the scheduler, obviously you can't yield to the scheduler. |
Let's have at least 1 release cycle between stabilizing |
Reopening to track deprecation of |
…=m-ou-se Deprecate atomic::spin_loop_hint in favour of hint::spin_loop For rust-lang#55002 We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
…=m-ou-se Deprecate atomic::spin_loop_hint in favour of hint::spin_loop For rust-lang#55002 We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
…=m-ou-se Deprecate atomic::spin_loop_hint in favour of hint::spin_loop For rust-lang#55002 We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
…=m-ou-se Deprecate atomic::spin_loop_hint in favour of hint::spin_loop For rust-lang#55002 We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
…=m-ou-se Deprecate atomic::spin_loop_hint in favour of hint::spin_loop For rust-lang#55002 We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
Now that |
See issue [#55002](rust-lang/rust#55002)
rclrs_examples fail to compile due to the following error ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /usr/local/cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/spin-0.9.2/src/relax.rs:26:9 | 26 | core::hint::spin_loop(); | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information Compiling bitvec v0.19.5 error: aborting due to previous error ``` As seen in the noted link, updating Rust can resolve the issue. This updates Rust in the Dockerfile to 1.49.0, where the issue seems to be resolved.
* Fix missing Dockerfile ARG Docker ARG REPOS_FILE was not redeclared in the "cacher" build stage, and so was not inheriting the default value specified at the top of the file. This redeclares the arg in the "cacher" build stage, so that the default value may be used. * Update Rust in Dockerfile to 1.49.0 rclrs_examples fail to compile due to the following error ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /usr/local/cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/spin-0.9.2/src/relax.rs:26:9 | 26 | core::hint::spin_loop(); | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information Compiling bitvec v0.19.5 error: aborting due to previous error ``` As seen in the noted link, updating Rust can resolve the issue. This updates Rust in the Dockerfile to 1.49.0, where the issue seems to be resolved.
This is necessary to resolve some compile errors on `master` currently. ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' Error: --> /home/runner/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/parking_lot_core-0.9.1/src/spinwait.rs:9:5 | 9 | use core::hint::spin_loop; | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' Error: --> /home/runner/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/parking_lot_core-0.9.1/src/spinwait.rs:16:9 | 16 | spin_loop() | ^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error: aborting due to 2 previous errors ```
This is necessary to resolve some compile errors on `master` currently. ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' Error: --> /home/runner/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/parking_lot_core-0.9.1/src/spinwait.rs:9:5 | 9 | use core::hint::spin_loop; | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' Error: --> /home/runner/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/parking_lot_core-0.9.1/src/spinwait.rs:16:9 | 16 | spin_loop() | ^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error: aborting due to 2 previous errors ```
* Changed `assert_eq!` tests to `assert!` to fix the build. * Added semicolons to last line of functions to make pedantic clippy happy. * Changed explicit impl of Default for timetoken.rs to be derived instead. * Refactored assertion in subscription.rs to make clippy happy. * Allowing unknown lints so that the build can pass. Older versions use `broken_intra_doc_links` and newer ones use `rustdoc::broken_intra_doc_links`, so the build fails on one or the other, so allowing unknown lints for now. * Formatting to make the linter happy. * Allowing unused async, because it's required for `ControlOutcome`, but Clippy insists it isn't. * Resolving issues detected by Clippy: "expression borrows a reference...that is immediately dereferenced by the compiler" * Bumping minimum version to Rust 1.49.0 due to: - rust-lang/rust#55002 - rust-lang/rust#70921 * Added TODOs to remove linter allows for unknown, renamed, and removed lints when Rust 1.59.0 becomes minimum version. * Added todo where the default UUID behavior is specified.
Rust v1.48 (installed from apt in Debian 11) fails as follows when running say_hello_rust: ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/loom/std/mod.rs:29:20 | 29 | pub(crate) use std::hint::spin_loop; | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/loom/std/mod.rs:100:9 | 100 | std::hint::spin_loop(); | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/sync/task/atomic_waker.rs:285:17 | 285 | hint::spin_loop(); | ^^^^^^^^^^^^^^^ | = note: see issue #55002 <rust-lang/rust#55002> for more information error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. error: could not compile `tokio`. To learn more, run the command again with --verbose. error: build failed ``` Checking our YDBRust pipeline, our pipeline uses the stable version of Rust (currently v1.59) to run its code. Therefore, I changed this Debian image to install the stable version of Rust. Misc changes: - Remove locales package, and remove US locale. We already use the C.UTF-8 locale, which is fine for YottaDB. Remove LANG and LANGUAGE varaibles, as these are not used by YottaDB. - Remove clang, add gcc, as it's required by go for the tests. gcc must have been implicitly added by other packages removed in the commit. clang isn't needed. - Remove vim, add nano instead.
Now that we have at least one thing in
std::hint
it makes sense to move this tostd::hint::spin_loop
.EDIT (@KodrAus)
Before stabilisation:
hint::spin_loop
orspin_loop_hint
)Stabilisation/deprecation:
renamed_spin_loop
feature [Stabilize hint::spin_loop #76097]sync::atomic::spin_loop_hint
functionThe text was updated successfully, but these errors were encountered: