Lecture 8: CPU Scheduling P2 Flashcards
Describe Shortest Job First (SJF)
An estimated CPU burst time is associated with each process. Scheduler uses this info to schedule shorter processes first.
What is the CPU burst time’s estimation based on?
Based on the durations of the previous bursts. (past can be a good predictor of the future)
Describe Priority Scheduling Algorithm
- A priority number (integer) is associated with each process.
- Higher = gets assigned CPU burst time first
- Aging causes low priority processes to increase in priority over time to combat starvation
Describe Round Robin Algorithm
- Each process assigned a time quantum (unit of time that represents how long they’re allowed CPU time for)
- If there are n processes in the ready queue, then each process gets at most q time units at once
- No process waits more than (n-1)q
What happens when time quantum is too large?
You get FIFO like behaviour
What happens when time quantum is too small?
Q must be large enough, otherwise overhead is too high
Results of Round Robin?
- Typically, higher average turnaround, but better response
- Turnaround time also depends on the size of the time quantum
Is SJF optimal or not widely used? Why?
It is optimal because it gives minimum average waiting time for a given set of processes
What are the two ways Multi-level Queues (without feedback) can be scheduled: ( as in scheduling the multiple queues )
1) Priority scheduling
2) Time Slice
Can a process move between queues in a:
Multi-level Queue without feedback?
Multi-level Queue with feedback?
No.
Yes.
How do processes move within a Multi-level Queue with feedback?
1) Moved to a lower-priority queue if process used too much CPU time
2) Moved to a higher-priority queue if process spends too much time in a lower priority queue