Operating Systems Internals and Design Principles 6E William Stallings Patricia Roy Manatee Community College Venice FL 2008 Prentice Hall Aim of Scheduling Assign processes to be executed by the processors ID: 698711
Download Presentation The PPT/PDF document "Chapter 9 Uniprocessor Scheduling" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Chapter 9
Uniprocessor Scheduling
Operating Systems:Internals and Design Principles, 6/EWilliam Stallings
Patricia Roy
Manatee Community College, Venice, FL
©2008, Prentice HallSlide2
Aim of Scheduling
Assign processes to be executed by the processor(s)Response timeThroughputProcessor efficiencySlide3
Types of SchedulingSlide4
Scheduling and Process State TransitionsSlide5
Levels of SchedulingSlide6
Long-Term Scheduling
Determines which programs are admitted to the system for processingControls the degree of multiprogrammingMore processes, smaller percentage of time each process is executedSlide7
Medium-Term Scheduling
Part of the swapping functionBased on the need to manage the degree of multiprogrammingSlide8
Short-Term Scheduling
Known as the dispatcherExecutes most frequentlyInvoked when an event occursClock interruptsI/O interruptsOperating system calls
SignalsSlide9
Short-Term Scheduling Criteria
User-orientedResponse TimeElapsed time between the submission of a request until there is output.System-orientedEffective and efficient utilization of the processorSlide10
Short-Term Scheduling Criteria
Performance-relatedQuantitativeMeasurable such as response time and throughputSlide11
Scheduling CriteriaSlide12
Scheduling CriteriaSlide13
Queuing DiagramSlide14
Priorities
Scheduler will always choose a process of higher priority over one of lower priorityHave multiple ready queues to represent each level of priorityLower-priority may suffer starvationAllow a process to change its priority based on its age or execution historySlide15
Priority QueuingSlide16
Decision Mode
NonpreemptiveOnce a process is in the running state, it will continue until it terminates or blocks itself for I/OSlide17
Decision Mode
PreemptiveCurrently running process may be interrupted and moved to the Ready state by the operating systemAllows for better service since any one process cannot monopolize the processor for very longSlide18
Process Scheduling ExampleSlide19
First-Come-First-Served
Each process joins the Ready queueWhen the current process ceases to execute, the longest process in the Ready queue is selectedSlide20
First-Come-First-Served
A short process may have to wait a very long time before it can executeFavors CPU-bound processesI/O processes have to wait until CPU-bound process completesSlide21
Round Robin
Uses preemption based on a clockSlide22
Round Robin
Clock interrupt is generated at periodic intervalsWhen an interrupt occurs, the currently running process is placed in the ready queueNext ready job is selectedKnown as time slicingSlide23
Effect of Size of Preemption Time QuantumSlide24
Effect of Size of Preemption Time QuantumSlide25
Queuing DiagramSlide26
Shortest Process Next
Nonpreemptive policyProcess with shortest expected processing time is selected nextShort process jumps ahead of longer processesSlide27
Shortest Process Next
Predictability of longer processes is reducedIf estimated time for process not correct, the operating system may abort itPossibility of starvation for longer processesSlide28
Exponential Smoothing CoefficientsSlide29
Use Of Exponential AveragingSlide30
Use Of Exponential AveragingSlide31
Shortest Remaining Time
Preemptive version of shortest process next policyMust estimate processing timeSlide32
Highest Response Ratio Next
Choose next process with the greatest ratioSlide33
Feedback
Penalize jobs that have been running longerDon’t know remaining time process needs to executeSlide34
Feedback SchedulingSlide35
Scheduling PoliciesSlide36
Scheduling PoliciesSlide37
Comparison of Scheduling PoliciesSlide38
FormulasSlide39
Normalized Response TimeSlide40
Normalized Response TimeSlide41
Normalized Response TimeSlide42
Normalized Turnaround TimeSlide43
Simulation Result for Waiting TimeSlide44
Fair-Share Scheduling
User’s application runs as a collection of processes (threads)User is concerned about the performance of the applicationNeed to make scheduling decisions based on process setsSlide45
Fair-Share SchedulerSlide46
Traditional UNIX Scheduling
Multilevel feedback using round robin within each of the priority queuesIf a running process does not block or complete within 1 second, it is preemptedPriorities are recomputed once per secondBase priority divides all processes into fixed bands of priority levelsSlide47
Bands
Decreasing order of prioritySwapperBlock I/O device controlFile manipulationCharacter I/O device controlUser processesSlide48
Example of Traditional UNIX Process Scheduling