title: Priority Preemptive Scheduling Numerical
body: <p>Calculate the waiting time for process P2 using priority based non preemptive scheduling algorithm. </p>
  
  <pre><code>        Process     Execution Time     Arrival Time      Priority
            P1           4                 0                 0
            P2           1                 1                 2
            P3           3                 2                 1
  </code></pre>
  
  <p>1). According to this algorithm, P1 has the highest priority 0 and it arrives first too. So the time slot for this is allocated as '4' units. </p>
  
  <p>2). Next, does Process3(P3) get executed first?
              Gannt chart:</p>
  
  <pre><code>               | P1 | P3 | P2 |
                 0    4    7    8
  </code></pre>
  
  <p>Or, is it the other way around?</p>
  
  <pre><code>               | P1 | P2 | P3 |
                 0    4    5    8
  </code></pre>
  
  <p>Is the arrival time of no importance in this procedure?</p>
  
  <p>Thanks!</p>