Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | Gate IT 2005 | Question 60

  • Difficulty Level : Medium
  • Last Updated : 28 Jun, 2021
We wish to schedule three processes P1, P2 and P3 on a uniprocessor system. The priorities, CPU time requirements and arrival times of the processes are as shown below.
 Process Priority CPU time required Arrival time
(hh:mm:ss)
 P1 10(highest) 20 sec 00:00:05
 P2 9 10 sec 00:00:03
 P3 8 (lowest) 15 sec 00:00:00

We have a choice of preemptive or non-preemptive scheduling. In preemptive scheduling, a late-arriving higher priority process can preempt a currently running process with lower priority. In non-preemptive scheduling, a late-arriving higher priority process must wait for the currently executing process to complete before it can be scheduled on the processor.
What are the turnaround times (time from arrival till completion) of P2 using preemptive and non-preemptive scheduling respectively.
(A) 30 sec, 30 sec
(B) 30 sec, 10 sec
(C) 42 sec, 42 sec
(D) 30 sec, 42 sec


Answer: (D)

Explanation: For Non preemptive scheduling

P3(AT=0)P1(AT=5)P2(AT=3)

0                                                       15                                                         35                                       45

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

Turn Around Time= Completion Time – Arrival Time = 45 -3 = 42



 

For Preemptive scheduling

P3P3P3P2P2P1P2P3

0                  1                    2                 3                  4                      5                  25                  33           45

Turn Around Time= Completion Time – Arrival Time = 33 – 3 = 30

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!