Question: Now consider a version of the bakery algorithm without the variable choosing. Then we have Int number[n]; While (true) { Number[i] = 1 + getmax
Int number[n];
While (true) {
Number[i] = 1 + getmax (number [], n);
For (int j = 0; j < n; j++) {
While ((number[j]! = 0) && (number[j],j) < (number[i],i)) { };
}
/* critical section */;
Number [i] = 0;
/* remainder */;
}
Does this version violate mutual exclusion? Explain why or why not.
Step by Step Solution
3.46 Rating (175 Votes )
There are 3 Steps involved in it
a With this inequality we can state that the condition in lines 45 is not satisfied and Pi can advance to stage j1 Since the act of checking the condi... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
E-CE-OS (334).docx
120 KBs Word File
