An operating system used Shortest Remaining System Time first (SRT) process…

2007

An operating system used Shortest Remaining System Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:

image.png

What is the total waiting time for process P2?

  1. A.

    5

  2. B.

    15

  3. C.

    40

  4. D.

    55

Attempted by 38 students.

Show answer & explanation

Correct answer: B

Process P1 runs from time 0 to 20. Process P2 arrives at 15 and waits until 20 (Wait: 5). At time 20, P2 starts. At time 30, P3 arrives with a shorter burst (10 vs remaining 15 of P2), preempting P2. P3 runs from 30 to 40. P2 resumes at 40 and finishes. Total waiting time for P2 = (20 - 15) + (40 - 30) = 5 + 10 = 15.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir