ITPEC FE Morning April 2022 Question 17

Topic: Software

An OS chooses a process for CPU execution based on the First-Come-First-Serve (FCFS) scheduling algorithm. There are four processes, P1, P2, P3, and P4, and their-arrival times and burst times are shown in the table below. Which of the following is the appropriate combination of waiting times for the processes to be executed? Here, the arrival time is the time at which a process enters the ready queue and is ready for execution, the burst time is the time a process requires for CPU execution, and the waiting time is the period of time a process spends in the ready queue waiting for the CPU to start execution.

Unit: milliseconds

ProcessArrival timeBurst time
P103
P225
P347
P452
OptionP1P2P3P4

Explanation

0, 1, 4, 10 ms — run the processes in arrival order; each waits from its arrival until the previous one finishes.

ProcessArrivalBurstStartFinishWaiting
P103030
P225381
P3478154
P452151710

Start = the later of the arrival time and the previous finish; waiting = start − arrival.

Answer (a)

Why not others:

  • •(b) 0, 2, 4, 5 — these are the arrival times, not the waiting times
  • •(c) 0, 3, 5, 7 — each value is the burst time of the process just before, ignoring both the earlier queue and the arrival time
  • •(d) 0, 3, 8, 15 — these are the start times; the arrival time is not subtracted

Key rule: Waiting time = start time − arrival time; build the start and finish timeline first, then subtract.

Software · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.