← BYTES
Unix IPC·Starter·Ref: 15.1.62
What is a spinlock, in the simplest terms?
Have a question about this video? Mention reference 15.1.62 when you contact us.
Thread B: is it free? no --> is it free? no --> is it free? YES!
(keeps checking in a tight loop, instead of sleeping)a.A lock that automatically unlocks itself after exactly one second
b.A lock where a thread waiting to acquire it repeatedly checks ('spins') in a tight loop rather than going to sleep, until the lock becomes available
c.A lock that can only be used by the root user
d.A lock that physically rotates a hard drive platter
A spinlock makes a waiting thread actively busy-loop, repeatedly checking whether the lock is now free, instead of yielding the CPU and going to sleep -- a real design tradeoff (covered further in later questions) between CPU usage and how quickly the thread notices the lock became available.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES15162#UnixIPC