Problem

Consider the following program which provides a software approach to mutual exclusion: int...

Consider the following program which provides a software approach to mutual exclusion: integer array control [1:N]; integer k

where 1 ≤ k ≤ N, and each element of “control” is either 0, 1, or 2. All elements of “control” are initially zero; the initial value of k is immaterial.

The program of the ith process (1 ≤ i ≤ N) is

begin integer j;

L0: control [i] := l;

LI: for j: = k step l until N, l step l until k do

 begin

  if j = i then goto L2;

  if control [j] ≠0 then goto L1

 end;

L2: control [i] : = 2;

 for j : = 1 step 1 until N do

  if j ≠i and control [j] = 2 then goto L0;

L3: if control [k] ≠ 0 and k ≠i then goto L0;

L4: k := i;

 critical section;

L5: for j : = k step 1 until N, 1 step 1 until k do

if j ≠ k and control [j] ≠ 0 then

begin

  k : = j;

   goto L6

 end;

L6: control [i] : = 0;

L7: remainder of cycle;

 goto L0;

end

This is referred to as the Eisenberg-McGuire algorithm. Explain its operation and its key features.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5