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)?
Answer: C. FCFS: P1, P2, P3 and RR: P1, P3, P2 — ConceptFCFS (First-Come-First-Served) is non-preemptive: each process runs to completion in the strict order it arrives, so the completion order is the same…
- 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 428 students.
Show answer & explanation
Correct answer: C
Concept
FCFS (First-Come-First-Served) is non-preemptive: each process runs to completion in the strict order it arrives, so the completion order is the same as the arrival order.
Round Robin is preemptive: every ready process gets a fixed CPU time slice (the quantum); if its burst is not finished within that slice, it goes to the back of the ready queue and waits for its next turn. The rule that decides ties: when a process arrives at the exact instant another process's quantum expires, the newly arrived process is placed in the ready queue ahead of the process that is being preempted.
Given
Process | Burst Time | Arrival Time |
|---|---|---|
P1 | 5 | 0 |
P2 | 7 | 2 |
P3 | 3 | 3 |
Time Quantum = 2
Application: 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 → P3Application: Round 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 → P2Cross-Check
Re-derive the ready-queue snapshots using the tie-break rule from the Concept section. At t=2, P1's first slice ends at the same instant P2 arrives, so the queue becomes [P2, P1] (P2 ahead, since it just arrived). At t=4, P2's slice ends; P3 had already arrived at t=3 (before t=4), so the queue at that point is [P1, P3, P2] -- P1 (already waiting) runs next, then P3 (which arrived before P2 was preempted), then P2. This is exactly why P3 gets the CPU ahead of P2 but not ahead of P1: P3 only jumps ahead of processes that are preempted after it arrives, never processes that were already sitting in the queue before it arrived.
A quick sanity check: the last process finishes at t=15, and the total of all three burst times is 5 + 7 + 3 = 15 -- the CPU never sits idle after t=0, which matches a fully busy schedule.
Final Answer
FCFS: P1, P2, P3
RR: P1, P3, P2A video solution is available for this question — log in and enroll to watch it.