Courses / HEC NSCT – National Skill Competency Test: Complete Preparation for Computing Graduates
9.2 CPU Scheduling
Area 9 – Operating Systems (5%) · 45 min read · 22 MCQs to check yourself
Goals
Maximise CPU utilisation and throughput; minimise turnaround time (completion − arrival), waiting time (turnaround − burst) and response time.
| Algorithm | Rule | Pre-emptive? | Note |
|---|---|---|---|
| FCFS | First come, first served | No | Simple; convoy effect (short jobs wait behind a long one) |
| SJF | Shortest burst next | No (SRTF is the pre-emptive version) | Minimum average waiting time; may starve long jobs |
| Priority | Highest priority next | Either | Starvation – fixed by aging (raise priority over time) |
| Round Robin | Each process gets a time quantum in turn | Yes | Fair, good response for time-sharing; quantum too large → FCFS, too small → many context switches |
| Multilevel queue | Separate queues (system, interactive, batch) | Multilevel feedback queue moves jobs between queues |
Worked example (FCFS), all arrive at time 0: P1 = 6, P2 = 3, P3 = 1. Gantt: P1 0–6, P2 6–9, P3 9–10. Waiting: 0, 6, 9 → average 5. With SJF: P3 0–1, P2 1–4, P1 4–10 → waiting 0, 1, 4 → average 1.67.
CPU scheduling – FCFS, SJF, Round Robin (Learn Coding)
This lesson ends with a quiz of 22 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: 9.1 OS Basics, Processes and Threads · Next: 9.3 Synchronization and Deadlocks