Week 5 (Lec 12-13) Flashcards
Scheduling Policies (18 cards)
What is workload in process scheduling?
The set of processes running on the system
What is turnaround time?
Tturnaround = Tcompletion - Tarrival.
COMPLETION - ARRIVAL
What is the FIFO policy?
First-in First-Out policy. First job to arrive is the first job o run.
Pros of FIFO policy?
Simple to implement, low overhead, works well under certain assumptions.
Cons of FIFO policy?
Convoy Effect. Short running jobs get stuck behind a long running job, resulting in poor average TURNAROUND time.
What is the SJF Policy?
Shortest Job First: Job with the shortest duration should run first/next.
Pros of SJF Policy
Solves the Convoy Effect ASSUMING all jobs arrive AT THE SAME TIME.
Cons of SJF Policy
If jobs don’t arrive at the same time, Convoy effect is still an issue.
What is preemptive scheduling?
When a scheduler can stop one process to run a different process.
How is preempting implemented? List a few ways/
Basic context switching and non-cooperative approach (a hardware timer interrupt)
What is STCF?
Shortest Time-To Completion First, basically SJF but adding preemption, allowing to switch processes in the middle of a process.
Pros of STCF?
Convoy Effect is no longer an issue.
Cons of STCF?
We don’t know how long a job will take, not great for response time.
What is response time?
Tresponse = Tfirstrun - Tarrival
The time to when it ARRIVES to The time it is SCHEDULED
What is the RR Policy?
Round Robin Policy: each job runs for a time slice before switching to the next job, continuously. The shorter the time slice, the better it is.
Pros of RR Policy?
Good for workloads where RESPONSE TIME is important. It’s also fair. (each job receives a proportional share)
Cons of RR Policy?
Context switching has costs / overhead. The shorter the time slice the more time is spent on context switching and less on execution.
Response time vs Turnaround time?
Turnaround: Arrival -> Completion
Response Time: Arrival -> First run