Strict Alternation (Software approach)

Busy waiting (notice the semicolons terminating the while statements in Fig. 17); 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 17: A proposed solution to the critical region problem. (a) Process 0. (b) Process 1.
\includegraphics[scale=1.1]{figures/06-04}

Cem Ozdogan 2010-03-23