

MCQOPTIONS
Saved Bookmarks
1. |
Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes Process X /* other code for process X */while (true) { varP = true; while (varQ == true) { /* critical section */ varP = false; } } /* other code for process X */ Process Y /* other code for process Y */ while (true) { varQ = true; while (varP == true) { /* critical section */ varQ = false; } } /* other code for process Y */ Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true? |
A. | The proposed solution prevents deadlock but fails to guarantee mutual exclusion |
B. | The proposed solution guarantees mutual exclusion but fails to prevent deadlock |
C. | The proposed solution guarantees mutual exclusion and prevents deadlock |
D. | The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion |
Answer» B. The proposed solution guarantees mutual exclusion but fails to prevent deadlock | |