A spinlock is a small lock implementation that typically consists of an atomic check and a conditional jump, forming a small loop that burns CPU cycles as long as the lock is blocking thread execution. Spinlocks are a good and a simple way to implement uncontended locks that are known to be held for a short time only. For most other applications, spinlocks are suboptimal.
See also Thin lock and Fat lock.
18.188.37.136