MCQs City stays free thanks to ads. Please turn off your ad blocker for this site so content and features keep working.
Operating System
Semaphores 1
Q
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes. Process P1 : while(true) { w1 = true; while(w2 == true); Critical section w1 = false; } Remainder Section Process P2 : while(true) { w2 = true; while(w1 == true); Critical section w2 = false; } Remainder Section Here, w1 and w2 have shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct?
AA. It does not ensure mutual exclusion
BB. It does not ensure bounded waiting
CC. It requires that processes enter the critical section in strict alternation
DD. It does not prevent deadlocks but ensures mutual exclusion
Correct Answer:
D. D. It does not prevent deadlocks but ensures mutual exclusion