• edited by
20,379 views
41 41 votes

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

$$\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time}\\\hline \text{P0} & \text{0 ms} & 9 \\\hline \text{P1} & \text{1 ms} & 4 \\\hline \text{P2} & \text{2 ms} & 9 \\\hline  \end{array}$$The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?

  1. $5.0$ ms
  2. $4.33$ ms
  3. $6.33$ ms
  4. $7.33$ ms

5 Answers

Best answer
44 44 votes

Answer is (A). $5$ms

Gantt Chart

$\text{ Average Waiting Time = } \dfrac{(0+4)+(0)+(11)}{3} = \text{ 5ms. }$

• edited by
1 1 vote

P   AT    BT      CT    TAT   WT

P0    0     9,8,0   13    13    4

P1    1     4,0     5     4     0

P2    2     9,0     22    20    11

P0,P1,P0,P1

Avg, waiting time = 15/3  = 5 Option A

Answer:
Position:
Show:

Related questions

75 75 votes
4 answers 4 answers
24.7k
24.7k views
go_editor asked Sep 29, 2014
24,661 views
On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to transfer $500$ bytes from an I/O device to mem...
55 55 votes
2 answers 2 answers
20.0k
20.0k views
go_editor asked Sep 29, 2014
19,975 views
An application loads $100$ libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as $10$ ms...
59 59 votes
7 answers 7 answers
39.0k
39.0k views
go_editor asked Sep 29, 2014
39,005 views
Let the page fault service time be $10$ milliseconds(ms) in a computer with average memory access time being $20$ nanoseconds (ns). If one page fault is generated every $...
83 83 votes
5 answers 5 answers
29.2k
29.2k views
go_editor asked Sep 29, 2014
29,184 views
A thread is usually defined as a "light weight process" because an Operating System (OS) maintains smaller data structure for a thread than for a process. In relation to ...