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 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What can you prevent issues related to downloading content form the internet
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
Social Studies, 15.09.2021 16:40
question
Mathematics, 15.09.2021 16:50
question
Chemistry, 15.09.2021 16:50
question
Mathematics, 15.09.2021 16:50
Questions on the website: 13722362