What are the basic differences between a semaphore & spin-lock?
When would we use a semaphore over a spin-lock?
spin lock can be held by only one process while semaphore can be held by one or more processes. Spin lock wait until the process releases a lock and then acquires a lock. Semaphore is sleeping lock i.e waits and goes to sleep.