Week 4 Flashcards
First Come First Serve
Oldest and simplest method. Non-preemptive method. Good for large batch systems that need to be as busy as possible. Disadvantages: large average wait time, variance in throughput is large, poor for reactivity. The convoy effect is prominent with this solution.
Convoy Effect
CPU job hogs CPU and many I/O jobs get queued up behind it.
Shortest Job First
Scheduling order based on amount of time the burst will take. Queue is maintained in order upon entrance. Non-preemptive method. Convoy effect still applies and its difficult to know how long processes will take.
Exponential average
Method used to estimate CPU burst lengths. Check picture in notes. Alpha is used to weight current and previous behavior. If alpha is low -> past behavior affects more and estimate moves slower. I alpha is high then most recent length matters more and behavior is fast to change. How alpha is chosen depends upon the system. Alpha*last length + (1-alpha) * previous estimate = current estimate.
Disadvantages of using exponential average technique
Predicted time always lags the real time.
Advantage of using exponential average technique
If the process spends a long time on the same size burst, the average will approach the true value.
Shortest Remaining Time First
Preemptive version of SJF. After an interrupt occurs, calculate remaining time on process. If process in queue has shorter burst time, put it on scheduler.
Starvation
Overcommitting resources to a CPU with too few resources
Round Robin
FCFS with preemption. Designed for time sharing systems.
Quantam
Maximum time the process gets to fun. A large enough quanta just become first come first serve. Small quanta is inefficient and will require lots of overhead
Hyper exponential distribution with quanta
Ideally 80% of bursts should be shorter than q
Priority Scheduling
Each process has a priority. Highest priority gets placed on CPU first and ready queue gets sorted based on this priority. Processes with same priority become first come first serve. Can be preemptive or non preemptive.
Multilevel queues
Multiple queues with different purposes and different priorities (I/O queue is higher than experimental). Each queue will have its own scheduling algorithm. Scheduling between queues is fixed priority preemptive scheduling sometimes with quanta.
Multi Level feedback.
Processes moving between queues. Processes that use entire quanta every time are bumped down and vice versa. Ideally, should sit on a queue that it sometimes exceeds but mostly doesn’t. Give small quanta to lower priority that guarantees it will run just not for long.
Parameters for multi level feedback
Determine when to upgrade process and to downgrade. Previous behavior of programs decides initial queue placement.