Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



Consider the following table of arrival time and burst time for three processes P0, P1, P2:

Process arrival time Burst time

 Processarrival time Burst time 
 P00 ms  7 
P1 1 ms 3 
P2 2ms 7 
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of a process. What is the average waiting time for the three processes?





Solution

Scheduling order:

$0$ to $1$: $P0$

At $t=1$, $P1$ arrives, so it preempts $P0$

$1$ to $4$: $P1$ completes

Now remaining:

$P0 = 6,\ P2 = 7$

So,

$4$ to $10$: $P0$ completes

$10$ to $17$: $P2$ completes

Waiting times:

For $P0$:

$10 - 0 - 7 = 3$

For $P1$:

$4 - 1 - 3 = 0$

For $P2$:

$17 - 2 - 7 = 8$

Average waiting time:

$\frac{3+0+8}{3} = \frac{11}{3} = 3.67\ \text{ms}$


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...