about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/library-features/spin-loop-hint.md41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/doc/unstable-book/src/library-features/spin-loop-hint.md b/src/doc/unstable-book/src/library-features/spin-loop-hint.md
deleted file mode 100644
index cd33f0c5e02..00000000000
--- a/src/doc/unstable-book/src/library-features/spin-loop-hint.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# `spin_loop_hint`
-
-The tracking issue for this feature is: [#41196]
-
-[#41196]: https://github.com/rust-lang/rust/issues/41196
-
-------------------------
-
-Many programs have spin loops like the following:
-
-```rust,no_run
-use std::sync::atomic::{AtomicBool,Ordering};
-
-fn spin_loop(value: &AtomicBool) {
-    loop {
-        if value.load(Ordering::Acquire) {
-             break;
-        }
-    }
-}
-```
-
-These programs can be improved in performance like so:
-
-```rust,no_run
-#![feature(spin_loop_hint)]
-use std::sync::atomic;
-use std::sync::atomic::{AtomicBool,Ordering};
-
-fn spin_loop(value: &AtomicBool) {
-    loop {
-        if value.load(Ordering::Acquire) {
-             break;
-        }
-        atomic::spin_loop_hint();
-    }
-}
-```
-
-Further improvements could combine `spin_loop_hint` with
-exponential backoff or `std::thread::yield_now`.