Question: Why doesn't this solution(in pseudo code) works for the 2 process mutual exclusion problem(before Peterson's algorithm)? Provide a detailed counter example showing where this algorithm
Why doesn't this solution(in pseudo code) works for the 2 process mutual exclusion problem(before Peterson's algorithm)? Provide a detailed counter example showing where this algorithm fails.

Shared Data: blocked: array [0..1] of Boolean; turn: 0..1; blocked [0]blocked[1]false; turn = 0; Local Data: ID: 0..1; /* (identifies the process; set to 0 for one process, 1 for the other/ Code for each of the two processes: repeat blocked [ID] true ; while(turn ID) do while (blocked [1-ID]) do nothing; turn = D; end loop; > blocked[ID] -false normal work >> forever
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
