Spin locks
Repeatedly: try to acquire the lock
In a cache coherent environment (invalidation-based):
- Test-and-set. Lots of writes (not good). Moreover, if bus-based, the contention on the bus can become unbearable
- Replace “test-and-set” with “test and test-and-set”. Keeps the test (read) local to the cache. Still racing condition when the lock is released. Then still lots of contention to get the lock (O(n**2)).
- Or use ll+sc
- Still racing condition when the lock is released (use of exponential backoff like in Ethernet)
- Use queuing locks