← BYTES
Unix IPC·Starter·Ref: 15.1.74
What does 'busy-waiting' mean?
Have a question about this video? Mention reference 15.1.74 when you contact us.
while (!ready) { } <-- just keeps looping and checking,
burning CPU the whole time it waitsa.A thread that is permanently asleep and will never wake up
b.A thread repeatedly checking a condition in a tight loop while waiting for it to become true, rather than yielding the CPU and sleeping until notified
c.A function that intentionally introduces random delays into a program
d.A thread that has crashed and is reporting an error
Busy-waiting is exactly what a spinlock does while waiting: continuously re-checking a condition rather than sleeping -- it can notice a change very quickly, but at the real cost of consuming CPU the whole time it's waiting, a tradeoff explored further in later questions.
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#BYTES15174#UnixIPC