No, a busy wait cannot probably be avoided altogether. In a uniprocessor system, one could inhibit interrupts during
wait()and
signal()operations in semaphores, but that is not possible in multiprocessor systems. In fact, a busy wait (or
spinlock), can be useful, especially in multiprocessor systems, when the wait is expected to be short (as with
wait()and
signal()), because no context switch is required when a process must wait on the lock.