GATE CS 2017 Set 1 — Question 24
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+1 / -0MediumSRTF (Preemptive SJF)Process SchedulingOperating SystemScheduling Numericals
Operating System → Process Scheduling → Scheduling Numericals
Last updated
Question
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below :
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _______ milliseconds.
| Process | Arrival time | Burst time |
|---|---|---|
| P1 | 0 | 7 |
| P2 | 3 | 3 |
| P3 | 5 | 5 |
| P4 | 6 | 2 |
Correct answer
3 to 3
Solution
Using the Pre-emptive Shortest Remaining Time First (SRTF) algorithm:
1.t=0 to 3: P1 arrives and starts. At , P1 has 4ms remaining.
2.t=3 to 6: P2 arrives with burst 3ms. Since , P2 preempts P1. P2 finishes at .
3.t=6 to 8: At , P4 arrives with burst 2ms. Remaining: P1(4), P3(5), P4(2). P4 is shortest. P4 finishes at .
4.t=8 to 12: Remaining: P1(4), P3(5). P1 is shorter. P1 finishes at .
5.t=12 to 17: P3 runs and finishes at .
Waiting Times (WT = Completion Time - Arrival Time - Burst Time):- P1: ms
- P2: ms
- P3: ms
- P4: ms
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Process Scheduling
2026 Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?2026 Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 1 Q35Consider a system consisting of instances of a resource , being shared by 5 processes.…2026 Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A…