microZEUS
The whole stack, hand-drawn.

◄ Wiki / OS

spinlock

A lock where a CPU waiting for it just keeps re-checking in a tight loop until it's free.

When a thread needs a lock held only very briefly, a spinlock has it busy-wait — spinning in place testing the lock — rather than paying the cost of sleeping and waking. It is efficient for short critical sections but wastes CPU if held long. A dangerous bug is a spinlock that never actually locks: threads sail through and shared data gets corrupted with no warning.

See also

  • semaphoreA counter used to coordinate threads, letting a limited number proceed while others wait.
  • SMPA computer with multiple equal CPU cores that share the same memory and can all run tasks at once.
  • schedulerThe part of an operating system that decides which thread runs on the CPU next, and switches between them.

Referenced by

segfault / segmentation fault · semaphore · SMP