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.  It does not ensure mutual exclusion B.  It does not ensure bounded waiting C.  It requires that processes enter the critical section in strict alternation D.  It does not prevent deadlocks but ensures mutual exclusion
Similar Questions
1. When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called?
A.  dynamic condition B.  race condition C.  essential condition D.  critical condition
2. If a process is executing in its critical section, then no other processes can be executing in their critical section. This condition is called?
A.  mutual exclusion B.  critical exclusion C.  synchronous exclusion D.  asynchronous exclusion
3. Which one of the following is a synchronization tool?
A.  thread B.  pipe C.  semaphore D.  socket
4.

A semaphore is a shared integer variable __________

A.  that can not drop below zero B.  that can not be more than zero C.  that can not drop below one D.  that can not be more than one
5. Mutual exclusion can be provided by the __________
A.  mutex locks B.  binary semaphores C.  

both a and b

D.  none of the mentioned
6. When high priority task is indirectly preempted by medium priority task effectively inverting the relative priority of the two tasks, the scenario is called __________
A.  priority inversion B.  priority removal C.  priority exchange D.  priority modification
7. Process synchronization can be done on __________
A.  hardware level B.  software level C.  both hardware and software level D.  none of the mentioned
8. A monitor is a module that encapsulates __________
A.  shared data structures B.  procedures that operate on shared data structure C.  synchronization between concurrent procedure invocation D.  all of the mentioned
9. To enable a process to wait within the monitor __________
A.  a condition variable must be declared as condition B.  condition variables must be used as boolean objects C.  semaphore must be used D.  all of the mentioned
10. Concurrent access to shared data may result in ____________
A.  data consistency B.  data insecurity C.  data inconsistency D.  none of the mentioned
OPERATING SYSTEM TOPICS