Create busy waiting

An illustration for busy waiting.  examples illustrate two threads that share a global integer i. The first thread uses busy-waiting to check for a change in the value of i: