Question: d. Given the code below: Assume the common variable lock is initially false and assuming testSet is an indivisible function that returns the value of
d. Given the code below: Assume the common variable lock is initially false and assuming testSet is an indivisible function that returns the value of its Boolean argument and sets the argument to True. Process A while (True) { while (testSet(lock)); Il critical section lock = false; // Non critical section } Process B while (True) { while (testSet(lock)); Il critical section lock = false; // Non critical section } (3pts) Does the code guarantee mutual exclusion? Explain your answer. (3pts) Is it possible processes will busy wait forever? Explain your answer (3pts) Is indefinite postponement possible? Explain your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
