Consider the set of process with arrival time (in milliseonds), CPU burst time (in millisecods) and priority (0 is the highest priority) shown below. None of the process have I/O burst timeThe average waiting time (in milli seconds) of all the process using premtive priority scheduling algorithm is ______
GATE CSE 2017Operating System › CPU SchedulingVerified
GATE CSE 2017 PYQ: Consider the set of process with arrival time (in milliseonds), CPU burst time (in millisecods) and priority…
Answer
29
Approach
Simulate preemptive priority scheduling where a smaller priority number means higher priority. Track the CPU timeline, preempting the running process whenever a newly arrived process has a strictly higher priority. Then compute waiting time for each process as completion time minus arrival time minus burst time, and average over all five processes.
The preemptive priority simulation gives completion times P1=49, P2=33, P3=51, P4=40, P5=67. Using total waiting time = sum(CT) - sum(AT) - sum(BT) = 240 - 28 - 67 = 145, the average waiting time is 145/5 = 29 ms.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.