Question: Consider the following program segments for two different processes (P1, P2) executing concurrently and where B and A are not shared variables, but X starts
Consider the following program segments for two different processes (P1, P2) executing concurrently and where B and A are not shared variables, but X starts at zero as a shared variable.
P1
DO A = 1, 5
X =X - 1
ENDDO
P2
DO B = 1, 4 X =X +1
ENDDO
If the processes P1 and P2 execute concurrently once at any speed, what are the possible resulting final values of x? Explain your answers.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
