edited by
24,186 views
43 votes
43 votes

Consider three processes (process id $0$, $1$, $2$ respectively) with compute time bursts $2$, $4$ and $8$ time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:

  1. $13$ units
  2. $14$ units
  3. $15$ units
  4. $16$ units
edited by

5 Answers

Best answer
50 votes
50 votes

A.

Gantt Chart is as follows.

$$\overset{\text{Scheduling Table}}{\begin{array}{|l|l|l|l|l|l|} \hline \textbf{P.ID} & \textbf{A.T} & \textbf{B.T} & \textbf{C.T} & \textbf{ T.A.T.} & \textbf{W.T.}\\\hline \text{P0} & 0 & 2 & 12 & 12 & 10 \\\hline \text{P1} & 0 & 4 & 13 & 13 & 9 \\\hline \text{P2} & 0 & 8 & 14 & 14 & 6 \\\hline \text{TOTAL} & \text{} & \text{} & \text{} &  39 & 25 \\\hline  \end{array}}$$

A.T.$=$ Arrival Time

B.T.$=$ Burst Time

C.T.$=$ Completion Time.

T.A.T.$=$ Turn Around Time

W.T.$=$ Waiting Time.

Average TAT $= 39/3 = 13$ units.

edited by
14 votes
14 votes

Here,

LRTF  means the process which has remaining time largest will run first and in case of same remaining time lowest process_id will be given priority to run. 

First 4 sec ,P2 will run . then P2 remaining time =4 ,p1=4,p0=2. 

Now P1 will get chance to run for 1 sec. P2=4,p1=3,p0=2.

Now p2 will get chance to run for 1 sec, P2=3,p1=3,p0=2.

This way if we do carefully, TAT of P1 will be 14 sec,p1=13 sec and p0= 12 sec.

Total TAT = 14+13+12= 39

Avg TAT= 39/3 =13 sec.

Answer:

Related questions