Ticket lock
Spinlock variant where each contender draws a ticket number and spins only until their turn arrives.
A naive spinlock causes cache stampedes when threads compete for the same memory location. Ticket lock avoids this by splitting the lock: a counter hands out tickets (your number), and another counter tracks whose turn it is (the serving number). Threads spin only on "is it my turn yet?" which causes far less cache contention. Modern CPUs often have special support for this pattern.
Ticket locks are fair — FIFO order is guaranteed — but require CAS operations and scale poorly if critical sections are long. For moderate contention they often outperform OS-level mutexes.