Busy spin
|
Missing image Merge_articles.png | It has been proposed that this article or section be merged with busy waiting.
This request may be discussed on the article's talk page. |
In software engineering, a busy spin is a process looping while continually rechecking for a condition (thus, "busy" for the continual checking, "spin" for the looping).
This is generally considered poor practice, as it eats up processor time, and is a particular concern in multi-tasking or multi-user environments. Busy spinning in an embedded system can also cause the system to waste significant amounts of power. However, spinning can be a valid strategy in certain special circumstances, most notably in the implementation of spinlocks within operating systems themselves.
Alternatives include event-driven programming and signals.
Busy spin is an example of an anti-pattern.
Busy spin is also known as "Busy waiting".