Computers and Technology

What are the disadvantages of Peterson’s solution for critical-section problem? Code below shows the solution to two process mutual exclusion problem. Process Pi
do {
flag[i] = true;
turn = j;
while (flag[j] && turn == j);
critical section
flag[i] = false;
remainder section
} while (true);
Process Pj
do {
flag[j] = true;
turn = i;
while (flag[i] && turn == i);
critical section
flag[j] = false;
remainder section
} while (true);

Answer True or False to the following questions:

a. This algorithm satisfies the "mutual exclusion", "progress" and "bounded waiting" condition.
b. This algorithm has a flaw as the variable "turn" can be modified by both processes at the same time.
c. This algorithm may cause "deadlock" if both processes set their flags to True at the same time.
d. This algorithm satisfies only the "mutual exclusion" and "progress" condition

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, angeline2004
At an open or uncontrolled intersection, yield if a. the cross road has more lanes than yours b. the cross road has fewer land than yours c. you’re on a state highway and the cross road is a secondary road d. do you have three or more passengers in your vehicle
Answers: 2
image
Computers and Technology, 22.06.2019 14:30, camerondillonn
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, jngonzo1226
Which of the following statements best describes it careers?
Answers: 2
image
Computers and Technology, 22.06.2019 19:20, SundaeSunday
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given. b)the definition of max_balance should be removed since header files should not contain constants. c)the definition of cashregister should be removed since header files should not contain class definitions. d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
Do you know the correct answer?
What are the disadvantages of Peterson’s solution for critical-section problem? Code below shows the...

Questions in other subjects:

Konu
Mathematics, 16.12.2020 19:50
Konu
Biology, 16.12.2020 19:50