Array-based Queuing Locks
Waiting processes poll on different locations in an array of size p
- Acquire
- fetch&inc to obtain address on which to spin (next array element)
- ensure that these addresses are in different cache lines or memories
- Release
- set next location in array, thus waking up process spinning on it
- O(1) traffic per acquire with coherent caches
- FIFO ordering, as in ticket lock, but, O(p) space per lock
- Not so great for non-cache-coherent machines with distributed memory
- array location I spin on not necessarily in my local memory (solution later)