subject

Dijkstra posed each of the following solutions as a potential software solution to the critical section problem and then explained why they failed [Dijkstra, 1968]. Provide your explanation about why they failed. a. proc (int i) {
while (TRUE ) {
compute;
while (turn ! = i);
critical_section ;
turn = (i+1) mod 2;
}
shared int turn;
turn = 1;
fork ( proc, 1, 0);
fork (proc, 1, 1); 8.6
b. proc (int i) {
while (TRUE)
compute;
while (flagt ( i+1 ) mod 21);
flag [i]
critical_section; TRUE;
flag[i] FALSE;
}
}
shared boolean flag[2];
flag[1] = FALSE; flag[0]
fork ( proc , 1, 0);
fork (proc, 1, 1);
c. proc (int i) {
while (TRUE ) {
compute;
flag [i] = TRUE ;
while (flagl (i+1) mod 2] );
critical_section;
flag [i] = TRUE; FALSE;
}
}
shared boolean flag[2];
flag[0] flag [ 1 ] = FALSE;
fork (proc, 1, 0);
fork ( proc, 1, 1);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 βˆ’+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
You know the right answer?
Dijkstra posed each of the following solutions as a potential software solution to the critical sect...
Questions
question
English, 10.02.2021 08:30
question
Mathematics, 10.02.2021 08:30
question
Physics, 10.02.2021 08:30
question
Mathematics, 10.02.2021 08:30
question
Arts, 10.02.2021 08:30
Questions on the website: 13722366