Consider the process details given in the following table. A new pre-emptive…

2017

Consider the process details given in the following table.

image.png

A new pre-emptive scheduling algorithm is proposed, i.e., the Longest Remaining Time Next (LRTN), wherein ties are broken by giving priority to the process with the highest priority. Calculate the following:

i) Turnaround time for Process P2

ii) Response time for Process P3

  1. A.

    (i) 20, (ii) 3

  2. B.

    (i) 19, (ii) 3

  3. C.

    (i) 19, (ii) 8

  4. D.

    (i) 20, (ii) 7

Attempted by 82 students.

Show answer & explanation

Correct answer: A

Considering Priority: 1 > 2 > 3 > 4 (smaller number = higher priority), the book-style LRTN scheduling is:
Process   BT   AT   Priority
P0         3    0       1
P1        9    2       4
P2        7    4       3
P3         6    3       2

Gantt Chart
0      2   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18  19   20   21   22   23   24  25
| P0 | P1 | P2 | P1 | P3 | P2 | P1 | P3 | P2 | P1 | P3 | P2 | P1 | P3 | P2 | P1 | P3 | P2 | P1 | P0 | P3 | P2 | P1 |

Completion Time Table
Process   AT   BT   CT   TAT   WT   RT
P0         0    3   22    22   19    0
P1         2    9   25    23   14    0
P2         4    7   24    20   13    0
P3         3    6   23    20   14    3

Where
TAT = CT − AT
WT = TAT − BT
RT = First Start Time − Arrival Time

Required Answers

Turnaround Time of P2 = 24 − 4 = 20

Response Time of P3 = 6 − 3 = 3

Explore the full course: Niacl Ao It Specialist