Spinlock

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.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.