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.

Why doesn't this solution(in pseudo code) works for the 2 process mutual

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!