Chapter 7 - Scheduling: Introduction Flashcards
5 simplifying assumptions
- equal run-time for all jobs
- simultaneous arrival Ta = 0
- no preemption
- CPU-only jobs
- known run-time
turnaround time?
Time from arrival to completion: T(completion) - T(arrival)
What does turnaround time capture?
How long a job spends in the system from arrival to finish
What is the convoy effect?
Short jobs wait behind long jobs, hurting responsiveness
When does FIFO perform poorly?
When job lengths vary
What is the main idea behind SJF?
Run the shortest jobs first to reduce average turnaround time
Is SJF preemptive?
No — once a job starts, it runs until completion
When is SJF optimal?
When all jobs arrive at the same time and run-times are known - not when arrival times vary
What is STCF?
A preemptive version of SJF — it allows switching to a shorter job if one arrives
response time formula
T(response) = T(firstrun) − T(arrival)
What is Round Robin (RR) scheduling?
A preemptive algorithm where each job gets a fixed time slice (quantum) to run
What happens when a job’s time slice ends? (RR)
It is preempted and placed at the back of the queue
advantages of RR
- Good response time
- Fairness (no CPU hogging)
- Works well for interactive tasks
disadvantages of RR
- High context-switch overhead if time slice is too short
- Poor turnaround time due to frequent interruptions
Why is the CPU-only job assumption unrealistic?
Real programs use I/O for input/output and network access
What happens when a job performs I/O?
It blocks and can’t use the CPU, allowing other jobs to run
How should the OS respond to I/O events?
Treat CPU bursts as separate mini-jobs to schedule effectively and avoid idle CPU time
What is the benefit of breaking a job with I/O into sub-jobs?
It improves responsiveness and CPU utilization