Question: (d) Consider a concurrent system with two processes A and B (Figure 1). Assume y is a shared variable with value of 5. Describe how


(d) Consider a concurrent system with two processes A and B (Figure 1). Assume y is a shared variable with value of 5. Describe how a race condition is possible and provide a solution to prevent the race condition from occurring. [6 marks) Figure 1: Concurrent processes A and B Process A Process B method incrementY() y=y+2 end incrementy method DecrementY() y=y-2 end Decrementy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
