Search⌘ K

Evaluating Spin Locks

Explore how spin locks function by evaluating their mutual exclusion correctness, fairness issues such as potential starvation, and performance trade-offs on single versus multi-CPU systems.

Given the basic spin lock, it can now be evaluated on how effective it is along our previously described axes.

Correctness

The most important aspect of a lock is correctness: does it provide mutual exclusion? The answer here is yes: the spin lock only allows a single thread to enter the critical section at a time. Thus, we have a correct lock.

Fairness

The next axis is ...