Question: The solution to the two-process mutual exclusion problem below was actually published in the January 1966 issue of Communications of the ACM. It doesn't work!

 The "solution" to the two-process mutual exclusion problem below was actually

The "solution" to the two-process mutual exclusion problem below was actually published in the January 1966 issue of Communications of the ACM. It doesn't work! Your task: Provide a detailed counterexample that lustrates the problem. As in lecture, assume that simple assignment statements (involving no computation) like turn = 0 are atomic. Shared Data: blocked: array[0. .1] of Boolean; turn: 0..1i blocked [1] false; blocked [0] 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 = ID; end loop; > blocked [ID] = false; > forever; The "solution" to the two-process mutual exclusion problem below was actually published in the January 1966 issue of Communications of the ACM. It doesn't work! Your task: Provide a detailed counterexample that lustrates the problem. As in lecture, assume that simple assignment statements (involving no computation) like turn = 0 are atomic. Shared Data: blocked: array[0. .1] of Boolean; turn: 0..1i blocked [1] false; blocked [0] 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 = ID; end loop; > blocked [ID] = false; > 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!