Question: Consider the following program which provides a software approach to mutual exclusion: Integer array control [1: N]; integer k Where 1 k N,
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 valueof 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
3.39 Rating (174 Votes )
There are 3 Steps involved in it
This is a program that provides mutual exclusion for access to a critical resource among N processes ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
451-C-S-D-B-O-S (71).docx
120 KBs Word File
