Aspire's Library

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

Previous Year Question (PYQs)



Given a CPU time slice of $2$ ms and the following list of processes.
Process Burst time $($ms$)$ Arrival time
$P1$ $3$ $0$
$P2$ $4$ $2$
$P3$ $5$ $5$
Find average turnaround time and average waiting time using round-robin CPU scheduling.





Solution

Time quantum $=2$ ms

Gantt chart:

$P1(0-2),\ P2(2-4),\ P1(4-5),\ P2(5-7),\ P3(7-9),\ P3(9-11),\ P3(11-12)$

Completion time:

$CT(P1)=5$

$CT(P2)=7$

$CT(P3)=12$

Turnaround time:

$TAT=CT-AT$

For $P1$:

$TAT=5-0=5$

For $P2$:

$TAT=7-2=5$

For $P3$:

$TAT=12-5=7$

Average turnaround time:

$\dfrac{5+5+7}{3}=\dfrac{17}{3}=5.66$

Waiting time:

$WT=TAT-BT$

For $P1$:

$WT=5-3=2$

For $P2$:

$WT=5-4=1$

For $P3$:

$WT=7-5=2$

Average waiting time:

$\dfrac{2+1+2}{3}=\dfrac{5}{3}=1.66$



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...