CS377 Spring 2019 More practice with interleavings: (Adapted from Problem 2.19 from Andrews's MPD text) Consider the following program: int x = 10, y = 0; co while (x != y) x = x - 1; y = y + 1; // x = 8; y = 2; oc +---------------------------------------------------------------------+ | x = 10; y = 0; | +---------------------------------------------------------------------+ | P | Q | +---------------------------------------------------------------------+ | p1: while (x != y) | q1: while (x != y) ; // spin | | p2: x <-- x - 1; | q2: x <-- 8; | | p3: y <-- y + 1; | q3: y <-- 2; | +---------------------------------------------------------------------+ Explain what it takes for the program to terminate. Can P terminate, but not Q? Can Q terminate, but not P? When the program does terminate, what are the final values for x and y? Construct scenarios. P Q x y -- -- -- -- p1 q1 10 0 Or describe in words.