Question
Consider the 3 processes, , and shown in the table.
| Process | Arrival time | Time Units Required |
|---|---|---|
| 0 | 5 | |
| 1 | 7 | |
| 3 | 4 |
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are
Official answer and solution
- Official answer
- C
- From
- Official GATE 2012 answer key
Solution
Simulate process execution and trace completion times under FCFS and RR2 scheduling policies.
- Under FCFS (First-Come First-Served):
- to : runs and finishes at .
- to : runs and finishes at .
- to : runs and finishes at .
- Completion order: .
- Under RR2 (Round Robin with time quantum = 2):
- At : arrives (burst 5). Runs from to (remaining: 3). arrives at . Ready queue: .
- At : runs from to (remaining: 5). arrives at . Ready queue: .
- At : runs from to (remaining: 1). Ready queue: .
- At : runs from to (remaining: 2). Ready queue: .
- At : runs from to (remaining: 3). Ready queue: .
- At : runs for its remaining 1 unit from to . completes at .
- At : runs for its remaining 2 units from to . completes at .
- At : runs for its remaining 3 units from to . completes at .
- Completion order: .
- Thus, completion orders are FCFS: and RR2: .
Final answer
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2012 Computer Science and Information Technology (CS)
- Question
- 31 of 65, printed as CS Q.31
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.