title: How many times will process P0 print "0"?
body: <p>The following program consists of 3 concurrent processes and 3 binary semaphores The
  semaphore, are initialized as S0=1 S1=0 S2=0</p>
  
  <p>Process P0:</p>
  
  <pre><code>while(1)
  {
  wait (S0);
  print '0';
  release (S1);
  release (S2);
  }
  </code></pre>
  
  <p>Process P1:</p>
  
  <pre><code>wait(S1);
  release (S0);
  </code></pre>
  
  <p>Process P2:</p>
  
  <pre><code>wait(S2);
  release (S0);
  </code></pre>
  
  <p>How many times will process PO print '0"??</p>
  
  <p>(A) At least twice (b) Exactly tWlce (c) Exactly thrice (d) Exactly once</p>
  
  <p>in this I have a confusion that Process P1 and P2 as will execute once or they will continue after executing once as they are not having while loop like process P0, if they will execute once only then According to me the answer should be (b), and if they will execute again then the answer will be (A) </p>
  
  <p>please help thanks in advance</p>