Uniprocessor Scheduling Chapter 9. Aim of Scheduling To improve: Response time: time it takes a system to react to a given input Turnaround Time (TAT)

Slides:



Advertisements
Similar presentations
Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Advertisements

Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Chapter 9 Uniprocessor Scheduling
1 Uniprocessor Scheduling Types of scheduling –The aim of processor scheduling is to assign processes to be executed by the processor so as to optimize.
Chapter 9 Uniprocessor Scheduling
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,
Chapter 3: CPU Scheduling
Chapter 9 Uniprocessor Scheduling
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
1 Uniprocessor Scheduling Module CPU Scheduling n We concentrate on the problem of scheduling the usage of a single processor among all the existing.
Chapter 9 Uniprocessor Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Informationsteknologi Tuesday, October 9, 2007Computer Systems/Operating Systems - Class 141 Today’s class Scheduling.
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
1 CPU Scheduling & Deadlock Operating Systems Lecture 4.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Main Job: Assign processes to be executed by the processor(s) and processes to be loaded in main.
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
Uniprocessor Scheduling
CSE 331 Operating Systems Design 1 Scheduling Scheduling is divided into various levels. These levels are defined by the location of the processes A process.
CPU Scheduling Chapter 6 Chapter 6.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
10CSE CPU Scheduling Copyrights Lecture Slides adapted from “ Advanced Operating Systems ”, Lecture Notes by Prof. Prof. Daniel Mosse, University Of Pittsburgh,
Lecture 5: Uniprocessor Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 CPU Scheduling We concentrate on the problem of scheduling the usage of a single processor among all the existing.
Chapter 9 Uniprocessor Scheduling Spring, 2011 School of Computer Science & Engineering Chung-Ang University.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Chapter 6 CPU SCHEDULING.
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
Chapter 9 - Scheduling I want a turn. Now!. BYU CS 345Scheduling2 Topics to Cover… Scheduling Priorities Preemption Response Time Algorithms Topics.
Operating Systems Lecture Notes CPU Scheduling Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Operating System Chapter 9. Uniprocessor Scheduling
Operating Systems Process Management.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Minimize response time Maximize throughput Maximize processor efficiency.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
Fall 2000M.B. Ibáñez Lecture 11 Uniprocessor Scheduling.
1 Uniprocessor Scheduling Chapter 9. 2 CPU Scheduling n We concentrate on the problem of scheduling the usage of a single processor among all the existing.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING. TYPES OF PROCESSOR SCHEDULING.
Uniprocessor Scheduling Chapter 9. Processor Scheduling Processor scheduling determines the assignment of processes to be executed by the processor over.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Uniprocessor Scheduling
Uniprocessor Scheduling
CPU Scheduling Chapter 5.
Uniprocessor Scheduling
Chapter 2.2 : Process Scheduling
Operating Systems CPU Scheduling.
Chapter 6: CPU Scheduling
OverView of Scheduling
Operating System Chapter 9. Uniprocessor Scheduling
Chapter 9 Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING
Chapter 9 Uniprocessor Scheduling
Uniprocessor Scheduling
Uniprocessor Scheduling
Presentation transcript:

Uniprocessor Scheduling Chapter 9

Aim of Scheduling To improve: Response time: time it takes a system to react to a given input Turnaround Time (TAT) = Total time spent in the system = waiting time + service time Throughput: jobs per minute (inverse of TAT)

Types of Scheduling

Part of the swapping function Swapping-in decision is based on the need to manage the degree of multiprogramming Known as the dispatcher Executes most frequently Invoked when an event occurs: Clock interrupts, I/O, OS calls, Signals, etc. Short-Term Scheduling Medium-Term Scheduling Determines which programs are admitted to the system for processing Controls the degree of multiprogramming More processes, smaller percentage of time each process is executed Which job to admit? FCFS, Priority, expected exec time, I/O req.s Long-Term Scheduling

Evaluation Criteria for Short-Term Scheduling Policies: User-oriented, performance related Turnaround time: time between submission and completion Response Time: time between submission and the first output. User-oriented, other Predictability : For users, it is important that a job runs the same way (Time & cost) regardless of the system load System-oriented, Performance related Maximize Throughput: rate at which processes are completed Processor utilization: percentage of time that the processor is busy System-oriented, other Fairness Enforcing priorities? Balancing resources? – Is it favoring processes that do not request stressed resources?

Priorities Scheduler chooses a process of higher priority over one of lower priority Use 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 Nonpreemptive Once a process is in the running state, it will continue until it terminates or blocks itself Preemptive Currently running process may be interrupted and moved to the Ready state due to an external event. No single process can monopolize the processor for very long  Better service Decision Mode

Process Scheduling Example

First-Come-First-Served (FCFS) Each process joins the Ready queue Nonpreemptive The oldest process in the ready queue is selected to run next Disadvantage : A short process may have to wait a very long time before it can execute Advantage : Favors CPU-bound processes I/O processes have to wait until CPU-bound process completes A B C D E

Preemption based on a clock (time slicing) Clock interrupt is generated at periodic intervals (time slice is determined a priori) When an interrupt occurs, the currently running process is placed in the ready queue and next ready job is selected to run A B C D E Round-Robin (RR)

Nonpreemptive Process with shortest expected processing time is selected next. For batch jobs, user is required to estimate the running time. If estimated time for process not correct, the OS may abort it. For interactive jobs, OS tries to predict it. Short process jumps ahead of longer processes Possibility of starvation for longer processes A B C D E Shortest Process Next (SPN)

Process Scheduling Example

Preemptive version of shortest process next policy Achieves better turnaround time as compared to SPN, because a short job is given immediate preference to a running longer job Risk of starvation for long jobs Must estimate the remaining processing time  Not easy! A B C D E Shortest Remaining Time (SRT)

Nonpreemptive An important performance criteria to minimize is: Normalized TurnAround Time = TAT / ServiceTime Choose next process with the highest response ratio R (so that it does not get any higher!) : A B C D E Highest Response Ratio Next (HRRN) No starvation possible with this formula, shorter jobs are favored against longer ones

Hard to predict the remaining time a process needs to execute. Instead, we can penalize jobs that have been running longer Each subsequent time that a job is preempted, it is moved to a lower-priority ready queue. This way, a longer process will gradually drift downward in the hierarchy of queues. starvation may occur if new jobs enter the system frequently To remedy this, increase priority if a job spends too much time in a lower priority queue and give more time quantum to lower priority queues A B C D E Feedback (FB)

A Comparison of Scheduling Policies

Characteristics of Various Scheduling Policies

Traditional UNIX Scheduling Designed to provide good response time for interactive users while ensuring that low-priority background jobs do not starve Multilevel feedback using round robin within each of the priority queues. 1-second preemption (much smaller in modern systems; ms) Priorities are recomputed once per second. It is based on process type and execution history In decreasing order of priority, the bands are as follows: Swapper Block I/O device control File manipulation Character I/O device control User processes