Question
Given the 2 assertions, prove the mutual exclusion is satisfied in Bakery Algorithm Assertion A: if processes i and k are in the bakery, and
Given the 2 assertions, prove the mutual exclusion is satisfied in Bakery Algorithm
Assertion A: if processes i and k are in the bakery, and i entered the bakery before k entered the doorway, then number[i] < number[k]
Assertion B: if process i executes its Critical Section, and process k is in the bakery (k !=i) then ( number[i], i ) < (number[k], k )
_________________________________________________________________________________________________________
while(true) {
choosing[i] = 1;
number[i] = 1 + max(number[1], , number[n]);
number[n]);
choosing[i] = 0;
for (int j = 1; j <= n; j++) {
while (choosing[j] = 1) {}
while(number[j] != 0 and (number[j],j) < (number[i], i)) {}
}
critical section
number[i] = 0;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started