Spinning around: Please don't!
Summary
The post analyzes spin-lock pitfalls, demonstrates common locking mistakes, and surveys practical mitigations such as atomic operations, PAUSE/yield strategies, backoff, and OS primitives (futex/WaitOnAddress). It argues that writing your own spin-lock is risky and emphasizes using OS synchronization primitives and careful tuning when unavoidable.