Question: Consider the following portions of two different programs running at the same time on four processors in a symmetric multicore processor (SMP). Assume that before
Consider the following portions of two different programs running at the same time on four processors in a symmetric multicore processor (SMP). Assume that before this code is run, both x and y are 0.
Core 1: x = 2;
Core 2: y = 2;
Core 3: w = x + y + 1;
Core 4: z = x + y;
1. What are all the possible resulting values of w, x, y, and z? For each possible outcome, explain how we might arrive at those values. You will need to examine all possible interleavings of instructions.
2. How could you make the execution more deterministic so that only one set of values is possible?
Step by Step Solution
3.41 Rating (160 Votes )
There are 3 Steps involved in it
1 x 2 y 2 w ... View full answer
Get step-by-step solutions from verified subject matter experts
