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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 10:00, austintules2005
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, sawyerfauver
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, Izzyfizzy
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, summerjoiner
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
You know the right answer?
Dijkstra posed each of the following solutions as a potential software solution to the critical sect...

Questions in other subjects:

Konu
Mathematics, 16.01.2022 06:50
Konu
Mathematics, 16.01.2022 06:50
Konu
Chemistry, 16.01.2022 07:00