What’s Wrong with Spinlocks?
What if you don’t have a special test and set instruction?
- Sometimes there’s something equivalent
- compare-and-swap is common
- You can disable interrupts, just long enough to do the test and set, rather than for the entire critical section
Think about processor efficiency
- Can (sort of) fix this problem with yield()