GATE CS 2019 Set 1 — Question 51
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0MediumSRTF (Preemptive SJF)Process SchedulingOperating SystemScheduling Numericals
Operating System → Process Scheduling → Scheduling Numericals
Last updated
Question
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is millisecond, then the value of is ___________.
| Process | P1 | P2 | P3 | P4 |
|---|---|---|---|---|
| Arrival time | 0 | 1 | 3 | 4 |
| CPU burst time | 3 | 1 | 3 |
Correct answer
2 to 2
Solution
The scheduling algorithm is preemptive Shortest Remaining Time First (SRTF), which is the preemptive version of Shortest Job First (SJF).Gantt Chart Analysis:
will execute before because it has a shorter remaining time.
Given average ms:
Since , this case is valid.Case 2:
will execute before (tie-break by arrival time if ).
This does not match the given average of ms.Therefore, the value of is .
- At : arrives with burst time . starts execution.
- At : arrives with burst time . 's remaining time is . Since , preempts .
- At : finishes. resumes with remaining time .
- At : arrives with burst time . 's remaining time is . Since , continues.
- At : finishes. arrives with burst time .
will execute before because it has a shorter remaining time.
- to : executes and finishes.
- to : executes and finishes.
Given average ms:
Since , this case is valid.Case 2:
will execute before (tie-break by arrival time if ).
- to : executes.
- to : executes.
This does not match the given average of ms.Therefore, the value of is .
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…