170 likes | 186 Views
This overview explores the different types of scheduling in operating systems, including long-term, medium-term, short-term, and I/O scheduling. It also discusses scheduling algorithms such as FCFS, Round-Robin, Priorities, Shortest Process Next, Feedback, Multiprocessor, and Real-Time Scheduling.
E N D
OverView of Scheduling Student: Xiuxian Chen ID:93036 Instructor:Mort Anvari Term: Fall 2000
Basic Concepts Scheduling is a fundamental operating-system function. Almost all computer resources are scheduling before use. The CPU is one the primary computer resources. Thus, its scheduling is central to operating-system design.
Types of Scheduling • Long-term Scheduling • Determines which programs are admitted to the system for processing • Controls the degree of multiprogramming • If more processes are admitted • less likely that all processes will be blocked better CPU usage • each process has less fraction of the CPU • The long term scheduler may attempt to keep a mix of processor-bound and I/O-bound processes
Types of Scheduling (Continue) • Medium-term Scheduling • Medium-term scheduling is part of the swapping function. Typically, the swapping-in decision is based on the need to manage the degree of multiprogramming.
Types of Scheduling (Continue) • Short-term Scheduling • Determines which process is going to execute next (also called CPU scheduling) • The short term scheduler is known as the dispatcher • Is invoked when an event occurs • Clock interrupts • I/O interrupts • Operating system calls and traps • Signals
Types of Scheduling (Continue) • I/O Scheduling • Decision as to which process’s pending I/O request shall be handled by available I/O device
Scheduling Criteria • CPU utilization • Throughput • Turnaround time • Waiting Time • Response time
Scheduling algorithms First-Come-First-Served (FCFS) • Each process joins the Ready queue • When the current process ceases to execute, the oldest process in the Ready queue is selected • A short process may have to wait a very long time before it can execute • Favors CPU-bound processes • I/O processes have to wait until CPU-bound process completes
Scheduling algorithms (continue) Round-Robin • Uses preemption based on a clock • An amount of time is determined that allows each process to use the processor for that length of time
Scheduling algorithms (continue) Priorities of Scheduling • Scheduler will always choose a process of higher priority over one of lower priority • Have multiple ready queues to represent each level of priority • Lower-priority may suffer starvation • allow a process to change its priority based on its age or execution history
Scheduling algorithms (continue) Shortest Process Next • Non preemptive policy • Process with shortest expected processing time is selected next • Short process jumps ahead of longer processes • Predictability of longer processes is reduced • If estimated time for process not correct, the operating system may abort it • Possibility of starvation for longer processes
Scheduling algorithms (continue) Feedback Scheduling • Process is demoted to the next lower-priority queue each time it returns to the ready queue • Longer processes drift downward • To avoid starvation, preemption time for lower-priority processes is longer
Scheduling algorithms (continue) Multiprocessor Thread Scheduling • Load sharing • processes are not assigned to a particular processor • Gang scheduling • a set of related threads is scheduled to run on a set of processors at the same time • Determined processor assignment • threads are assigned to a specific processor • Dynamic Scheduling • number of threads can be altered during course of execution
Scheduling algorithms (continue) Real-Time Scheduling • Static table-driven • determines at run time when a task begins execution • Static priority-driven preemptive • traditional priority-driven scheduler is used • Dynamic planning-based • Dynamic best effort
References • Operating systems: internals and Design Principles, third Edition by William Stallings • http://www.cs.panam.edu/~meng/Course/CS4334/Note/master/node17.html • http://www.iranma.org/os/