File tree 2 files changed +14
-14
lines changed
2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -59,13 +59,13 @@ pub unsafe fn unreachable_unchecked() -> ! {
59
59
/// busy-wait spin-loop without yielding control to the system's scheduler.
60
60
///
61
61
/// Using a busy-wait spin-loop with `spin_loop` is ideally used in situations where a
62
- /// contended lock is held by another thread executed on a different CPU or core and where the waiting
63
- /// times are relatively small. Because entering busy-wait spin-loop does not trigger the system's
64
- /// scheduler, no overhead for switching threads occurs. However, if the thread holding the
65
- /// contended lock is running on the same CPU or core, the spin-loop is likely to occupy an entire CPU slice
66
- /// before switching to the thread that holds the lock. If the contending lock is held by a thread
67
- /// on the same CPU or core or if the waiting times for acquiring the lock are longer, it is often better to
68
- /// use [`std::thread::yield_now`].
62
+ /// contended lock is held by another thread executed on a different CPU or core and where the
63
+ /// waiting times are relatively small. Because entering busy-wait spin-loop does not trigger the
64
+ /// system's scheduler, no overhead for switching threads occurs. However, if the thread holding the
65
+ /// contended lock is running on the same CPU or core, the spin-loop is likely to occupy an entire
66
+ /// CPU slice before switching to the thread that holds the lock. If the contending lock is held by
67
+ /// a thread on the same CPU or core or if the waiting times for acquiring the lock are longer, it
68
+ /// is often better to use [`std::thread::yield_now`].
69
69
///
70
70
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
71
71
/// do anything at all.
Original file line number Diff line number Diff line change @@ -134,13 +134,13 @@ use crate::hint::spin_loop;
134
134
/// busy-wait spin-loop without yielding control to the system's scheduler.
135
135
///
136
136
/// Using a busy-wait spin-loop with `spin_loop_hint` is ideally used in situations where a
137
- /// contended lock is held by another thread executed on a different CPU or core and where the waiting
138
- /// times are relatively small. Because entering busy-wait spin-loop does not trigger the system's
139
- /// scheduler, no overhead for switching threads occurs. However, if the thread holding the
140
- /// contended lock is running on the same CPU or core, the spin-loop is likely to occupy an entire CPU slice
141
- /// before switching to the thread that holds the lock. If the contending lock is held by a thread
142
- /// on the same CPU or core or if the waiting times for acquiring the lock are longer, it is often better to
143
- /// use [`std::thread::yield_now`].
137
+ /// contended lock is held by another thread executed on a different CPU or core and where the
138
+ /// waiting times are relatively small. Because entering busy-wait spin-loop does not trigger the
139
+ /// system's scheduler, no overhead for switching threads occurs. However, if the thread holding the
140
+ /// contended lock is running on the same CPU or core, the spin-loop is likely to occupy an entire
141
+ /// CPU slice before switching to the thread that holds the lock. If the contending lock is held by
142
+ /// a thread on the same CPU or core or if the waiting times for acquiring the lock are longer, it
143
+ /// is often better to use [`std::thread::yield_now`].
144
144
///
145
145
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
146
146
/// do anything at all.
You can’t perform that action at this time.
0 commit comments