Evaluating Spin Locks
Let's evaluate the spin locks under the metrics of correctness, fairness, and performance.
We'll cover the following...
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 ...