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?
  • A A. It does not ensure mutual exclusion
  • B B. It does not ensure bounded waiting
  • C C. It requires that processes enter the critical section in strict alternation
  • D D. It does not prevent deadlocks but ensures mutual exclusion
Leave a Comment