Question: Now consider a version of the bakery algorithm without the variable choosing. Then we have 1 int number[n]; 2 while (true) { 3 number[i] =
1 int number[n];
2 while (true) {
3 number[i] = 1 + getmax(number[], n);
4 for (int j = 0; j < n; j++){
5 while ((number[j]! = 0) && (number[j],j) < (number[i],i)) { };
6 }
7 /* critical section */;
8 number [i] = 0;
9 /* remainder */;
10 }
Does this version violate mutual exclusion? Explain why or why not.
Step by Step Solution
3.58 Rating (169 Votes )
There are 3 Steps involved in it
Suppose we have two processes just beginning call them p0 and p1 Both reach line 3 at the same time ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
451-C-S-D-B-O-S (70).docx
120 KBs Word File
