Skip to content
Search

Busy waiting

lastmod 2018-08-17created 2017-05-103 edits

Busy waiting (also spinning) is a phenomenon that occurs in the process of acquiring access rights in a synchronization situation where two or more processes or threads try to obtain the right to use a particular shared resource. In most cases it is considered the same as a spinlock (Spin-lock), but strictly speaking, a spinlock is something that uses the concept of busy waiting.

Pros and cons

Busy waiting can be used simply when there is confidence that access to the shared resource will be acquired within a very short time, or when the overhead of using synchronization objects such as mutexes or semaphores is too large. On the other hand, on a single-processor system based on simple priority scheduling or FCFS (First-come First-served) scheduling, applying busy waiting may cause the system to hang. Therefore it is preferable to use it in a multiprocessor environment, and there is also the restriction that, when using a shared resource after obtaining access through busy waiting, only very short operations should be performed and the access should be released immediately.

See also

Favorite site