Strict Alternation (Software approach)

Busy waiting (notice the semicolons terminating the while statements in Fig. 6.4); continuously testing a variable until some value appears, a lock that uses busy waiting is called a spin lock. It should usually be avoided, since it wastes CPU time.
Figure 6.4: A proposed solution to the critical region problem. (a) Process 0. (b) Process 1.
\includegraphics[scale=1.1]{figures/06-04}
Cem Ozdogan 2011-02-14