CPU scheduling: FCFS and SJF
45 min · Intermediate
CPU scheduling decides which ready process gets the CPU next. Placement tests ask you to draw a Gantt chart (a timeline of who ran when) and compute average waiting and turnaround times, so this lesson works every number exactly and checks it with a small Java simulator.
Topics in this lesson
- Terms: arrival, burst, waiting, turnaround and response time
- FCFS with a Gantt chart and the convoy effect
- SJF and SRTF with worked averages
- Preemptive vs non-preemptive scheduling
- Worked numeric example with exact averages
Interview questions this lesson answers
- What is CPU scheduling and why is it needed?
- What are the scheduling criteria?
- What is throughput?
- What is CPU utilisation?
- What is the difference between turnaround time and waiting time?
- What is response time, and why does it matter more for interactive systems?
- When does the scheduler have to make a decision?
- What is the difference between preemptive and non-preemptive scheduling?
- How does FCFS work, and is it preemptive?
- Can FCFS cause starvation?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.