Consider the following processes P1 and P2 that update the value of the shared variables, x and

Question:

Consider the following processes P1 and P2 that update the value of the shared variables, x and y, as follows:

Assume that the initial values of x and y are 2 and 3 respectively. P1 enters the system first and so it is required that the output is equivalent to a serial execution of P1 followed by P2. The scheduler in the uniprocessor system implements a pseudo-parallel execution of these two concurrent processes by interleaving their instructions without restricting the order of the interleaving.
a. If the processes P1 and P2 had executed serially, what would the values of x and y have been after the execution of both processes?
b. Write an interleaved concurrent schedule that gives the same output as a serial schedule.
c. Write an interleaved concurrent schedule that gives an output that is different from that of a serial schedule.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: