Semaphores vs. Spinlocks
This version of semaphore is only a thin layer above a spinlock
- P() is pretty much “test and unset”
We still have the busy waiting problem
Let’s try again
- This time, give each semaphore a wait queue
- Threads trying to get into the critical section can wait on the queue