Consider the following table and answer the given question: Process ID CPU…
2018
Consider the following table and answer the given question:
Process ID | CPU Burst | Arrival Time |
P1 | 5 | 0 |
P2 | 7 | 2 |
P3 | 3 | 3 |
Which of the following options represents the completion order of the three processes under the FCFS (first come, first served) and RR (round robin) policies (with CPU quantum of 2 time units)?
- A.
FCFS: P1, P2, P3 and RR: P3, P1, P2
- B.
FCFS: P3, P2, P1 and RR: P3, P2, P1
- C.
FCFS: P1, P2, P3 and RR: P1, P3, P2
- D.
FCFS: P1, P3, P2 and RR: P1, P2, P3
Attempted by 160 students.
Show answer & explanation
Correct answer: C
Given
Process | Burst Time | Arrival Time |
|---|---|---|
P1 | 5 | 0 |
P2 | 7 | 2 |
P3 | 3 | 3 |
Time Quantum = 2
FCFS Scheduling
FCFS executes processes in the order of arrival.
Execution Order
P1 arrives first and completes first
P2 arrives second and completes second
P3 arrives third and completes third
Therefore, FCFS completion order is:
P1 → P2 → P3Round Robin Scheduling (Quantum = 2)
Step-by-Step Execution
Time | Process Executed | Remaining Burst Time |
|---|---|---|
0–2 | P1 | 3 |
2–4 | P2 | 5 |
4–6 | P1 | 1 |
6–8 | P3 | 1 |
8–10 | P2 | 3 |
10–11 | P1 | 0 ✅ |
11–12 | P3 | 0 ✅ |
12–14 | P2 | 1 |
14–15 | P2 | 0 ✅ |
Completion Order
P1 completes first
P3 completes second
P2 completes last
Hence, Round Robin completion order is:
P1 → P3 → P2Final Answer
FCFS: P1, P2, P3
RR: P1, P3, P2