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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!