Test and Test-and-Set
Replace “test-and-set” with “test and test-and-set”.
- Keep the test (read) local to the cache.
- First test in the cache (non atomic). If lock cannot be acquired, repeatedly test in the cache (no bus transaction)
- On lock release (write 0 in memory location) all other cached copies of the lock are invalidated.
- Still racing condition for acquiring a lock that has just been released. (O(n**2) bus transactions for n contending processes).
Can use ll+sc but still racing condition when the lock is released