Home » Operating Systems » Operating systems miscellaneous » Question

Operating systems miscellaneous

  1. Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.

    Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is ____________________.
    1. 7.2 milli seconds
    2. 2 milli seconds
    3. 1.5 milli seconds
    4. 72 milli seconds
Correct Option: A

As we know, in the shortest remaining time first algorithm, at a given time t, process p is scheduled if its remaining execution time is minimum among all processes. (Note that this algo is applicable only when all processes declare their execution time in advance before they begin).
Now the Gantt chart for the given processes is as follows:

The first column of the table indicates the running time. Each entry in the table indicates the remaining execution time of that process at that time. Here a ‘–’ indicates that a process has not arrived and a ‘zero’ indicates that the process has finished. The last column indicates the process selected for execution that has shortest remaining execution time; these are marked with red circles. Using the Gantt chart, the arrival time, termination time and turnaroud time of different processes is as follows :

Process Arrival Time Termination Time Turnaround Time (m sec)
A 0 8 8
B 3 5 2
C 5 12 7
D 7 21 14
E 10 15 5

Total turnaround item of all processes = 36 m sec.
Average turnaround time =
36
= 7.2 m sec.
5



Your comments will be displayed only after manual approval.