Question 14
Consider the following code snippet from Bakery Algorithm.
lock(i) { num[i] = MAX(num[0], num[1], ..., num[N-1]) + 1; for (p = 0; p < N; ++p) { while (num[p] != 0 && num[p] < num[i]); }}critical section
unlock(i) {num[i] = 0;}Considering that there are 5 processes, and initially num[0]=3 num[1]=0, num[2]=5, num[3]=2, num[4]=4, If Process 4 (num[3]) starts executing its critical section and then unlocks, what will be the new value of num[3] after P4 finishes execution?