Scheduling Metrics & the Ready Queue
Every scheduling policy is judged by the same numbers. Learn the vocabulary once, and every algorithm becomes a comparison instead of a memorization exercise.
In plain English
Scheduling metrics are report-card scores: how long people wait, how fast work finishes, and how busy the CPU stays.
By the end you will be able to
- Define arrival, burst, completion, turnaround, waiting, and response time.
- Compute turnaround and waiting time from a Gantt chart.
- Explain throughput and CPU utilization.
- Read a process table and build a timeline.
The process table
Scheduling problems start with a table: process ID, arrival time, and burst time. Arrival time is when the process enters the ready queue. Burst time is how much CPU time it needs. A priority may also be given. From these inputs, a policy produces a timeline (Gantt chart) and a set of per-process completion times.
Process Arrival Burst
P1 0 5
P2 1 3
P3 2 1The formulas
Completion time is when the process finishes. Turnaround time is completion minus arrival. Waiting time is turnaround minus burst, which is the total time spent ready but not running. Response time is the first time the process gets the CPU minus its arrival. Average waiting and average turnaround are the sums divided by the number of processes.
turnaround = completion - arrival
waiting = turnaround - burst
response = first_run - arrival
average_waiting = sum(waiting) / nA worked FCFS example
Using the table above with FCFS, P1 runs 0–5, P2 runs 5–8, and P3 runs 8–9. Completion times are 5, 8, and 9. Turnaround is 5, 7, and 7. Waiting is 0, 4, and 6. Average waiting is (0 + 4 + 6) / 3 = 3.33. Average turnaround is (5 + 7 + 7) / 3 = 6.33. Every scheduling lesson will ask you to reproduce this kind of table.
Key takeaways
- Turnaround = completion - arrival.
- Waiting = turnaround - burst.
- Response time measures the first CPU allocation, not completion.
- A Gantt chart is the source of truth for every metric.
- Averages are sums divided by the number of processes.
Common pitfalls
- Using burst time instead of completion time for turnaround.
- Forgetting to subtract arrival time.
- Computing waiting time as completion minus burst without subtracting arrival.
Kernel notes
- Build a process table and a Gantt chart before computing anything.
- Double-check each metric with the formulas.
- Know which metric a policy is trying to optimize.
Quick check
1. A process arrives at 2 and completes at 9. What is its turnaround time?
2. If turnaround is 7 and burst is 3, what is waiting time?