GATE CS 2014 Set 1 — Question 42
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 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 ____________________.
| Process Name | Arrival Time | Execution Time |
|---|---|---|
| A | 0 | 6 |
| B | 3 | 2 |
| C | 5 | 4 |
| D | 7 | 6 |
| E | 10 | 3 |
Correct answer
7.2 to 7.2
Solution
We use Shortest Remaining Time First (SRTF) scheduling (preemptive).Timeline:
msec.
- t=0: A arrives (Burst 6). A starts. (A rem: 6)
- t=3: B arrives (Burst 2). A has run for 3ms (A rem: 3). Compare A(3) vs B(2). B is shorter. Preempt A. B starts.
- t=5: C arrives (Burst 4). B has run for 2ms (B rem: 0). B finishes. Turnaround B = .
- Ready: A(3), C(4). A is shorter. A resumes.
- t=7: D arrives (Burst 6). A has run for 2ms more (A rem: 1). Compare A(1) vs C(4) vs D(6). A is shortest. A continues.
- t=8: A finishes (1ms more). A finishes. Turnaround A = .
- Ready: C(4), D(6). C is shorter. C starts.
- t=10: E arrives (Burst 3). C has run for 2ms (C rem: 2). Compare C(2) vs D(6) vs E(3). C is shortest. C continues.
- t=12: C finishes (2ms more). C finishes. Turnaround C = .
- Ready: D(6), E(3). E is shorter. E starts.
- t=15: E finishes (3ms). E finishes. Turnaround E = .
- Ready: D(6). D starts.
- t=21: D finishes (6ms). D finishes. Turnaround D = .
- A: 8
- B: 2
- C: 7
- D: 14
- E: 5
msec.
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…