documentation enhancement for 'spin loop hint': replace 'CPU' with 'CPU or core'
This commit is contained in:
parent
61dced1827
commit
356b4c81a0
2 changed files with 6 additions and 6 deletions
|
@ -59,12 +59,12 @@ pub unsafe fn unreachable_unchecked() -> ! {
|
|||
/// busy-wait spin-loop without yielding control to the system's scheduler.
|
||||
///
|
||||
/// Using a busy-wait spin-loop with `spin_loop` is ideally used in situations where a
|
||||
/// contended lock is held by another thread executed on a different CPU and where the waiting
|
||||
/// contended lock is held by another thread executed on a different CPU or core and where the waiting
|
||||
/// times are relatively small. Because entering busy-wait spin-loop does not trigger the system's
|
||||
/// scheduler, no overhead for switching threads occurs. However, if the thread holding the
|
||||
/// contended lock is running on the same CPU, the spin-loop is likely to occupy an entire CPU slice
|
||||
/// contended lock is running on the same CPU or core, the spin-loop is likely to occupy an entire CPU slice
|
||||
/// before switching to the thread that holds the lock. If the contending lock is held by a thread
|
||||
/// on the same CPU or if the waiting times for acquiring the lock are longer, it is often better to
|
||||
/// on the same CPU or thread or if the waiting times for acquiring the lock are longer, it is often better to
|
||||
/// use [`std::thread::yield_now`].
|
||||
///
|
||||
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue