Question Four 5 Marks Learning Outcomes What are the disadva

Question Four 5 Marks Learning Outcome(s): What are the disadvantages of Peterson\'s solution for critical-section problem? Code Describe the OS below shows the solution to two process mutual exclusion problem mechanism for process managementProcess P timing, memory, do VO, file and agitrue; turn -j while (flag[il&&turn; critical section nagli] false; remainder section while (trne); Process Pj naglil true; turn-i while (flag[il&& turni: critical section laglil false; remainder section while (true): Answer True or F the following questions: (i) This algorithm satisfies the \"mutual exclusion\", \"progress\" and \"bounded waiting Pg. 5 Question Four ii) This algorithm has a flaw as the variable \"turn\" can be modified by both processes at the same time. iii) This algorithm may cause \"deadlock\" if both processes set their flags to True at the same time. iv) This algorithm satisfies only the mutual exclusion\" and \"progress\" condition.

Solution

Disadvantages of Peterson’s solution for critical-section problem

1) The original Peterson’s Algorithm works with only 2 processes.

2) The Peterson\'s algorithm requires multi-writer registers.

i) true,because only one process in the critical section This algorithm satisfies the “mutual exclusion”, “progress” and “bounded waiting” condition.

ii) true, if one process is in the critical section than other must be in wait so this has flaw, turn” can be modified by both processes at the same time.

iii) true,if both processes set their flags to True at the same time than this alorithm can\'t determine which process go to critical section and go to infinite loop.

iv) false, This algorithm satisfies all 3 condition “mutual exclusion”, “progress” and “bounded waiting” condition.

 Question Four 5 Marks Learning Outcome(s): What are the disadvantages of Peterson\'s solution for critical-section problem? Code Describe the OS below shows th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site