busy wait
also: spin waiting, polling
A CPU-intensive waiting technique where a process repeatedly checks a condition in a tight loop instead of blocking or sleeping, consuming CPU cycles unnecessarily.
Busy waiting (or spin waiting) occurs when a program polls a resource or condition continuously without yielding CPU time. Instead of using efficient blocking mechanisms like sleep(), wait(), or event notifications, the process spins in a loop checking if its condition is met.
A simple example:
while (!ready) {
// CPU spins here, wasting cycles
}
// proceed versus the efficient approach: sleep(100); // pause and let other processes run
if (ready) proceed;Busy waiting degrades system performance because the process wastes CPU cycles that could serve other processes. This is especially problematic in multitasking systems. Modern Linux provides efficient alternatives like condition variables, mutexes, poll(), select(), and epoll() that put processes to sleep until an event actually occurs.