Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,

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
A. Frank - P. Weisberg Operating Systems Advanced CPU 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.
Chapter 3: CPU Scheduling
Chapter 9 Uniprocessor Scheduling
Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs. Nonpreemptive Scheduling 8.4Priorities 8.5Scheduling Objectives.
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.
7/12/2015Page 1 Process Scheduling B.Ramamurthy. 7/12/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
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.
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.
Uniprocessor Scheduling
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.
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 - Scheduling I want a turn. Now!. BYU CS 345Scheduling2 Topics to Cover… Scheduling Priorities Preemption Response Time Algorithms Topics.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Operating System Chapter 9. Uniprocessor Scheduling
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)
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
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.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
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
Day 25 Uniprocessor scheduling
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 9 Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING
Chapter 9 Uniprocessor Scheduling
Uniprocessor Scheduling
Uniprocessor Scheduling
Presentation transcript:

Day 25 Uniprocessor scheduling

Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system, waiting and executing, so far e – time spent in execution, so far s- total service time required by the process Service time – the time that the process actually runs (includes e)

Algorithm: Decision Mode Non-pre-emptive Once a process is in the running state, it will continue until it terminates or blocks itself for I/O Selection function is used only when a process blocks or terminates Pre-emptive Currently running process may be forced to release the processor and moved to the Ready state by the operating system Allows for better service since any one process cannot monopolize the processor for very long More switching overhead Selection function is used when a process blocks or terminates or when a new process enters the system or when a time slice expires.

First-Come-First-Served (FCFS/FIFO) Each process joins the Ready queue When the current process ceases to execute, the oldest process in the Ready queue is selected non-pre-emptive A short process may have to wait a very long time before it can execute

FCFS Arrival time Service Time P P2 1 3 P3 2 3 Calculate the turn-around time for each process and the average turn-around time.

FCFS Favors CPU-bound processes I/O processes have to wait until CPU-bound process completes Inefficient use of processor and I/O devices. Rarely used on its own.

Process Scheduling Example

First-Come-First-Served (FCFS) A B C D E

Shortest Process Next (SPN) Select the shortest process in the ready queue. Non-pre-emptive. Reduces the response time for shorter processes. Less predictable response time for longer processes. Must estimate the running time for each process.

Process Scheduling Example

Shortest Process Next (SPN) A B C D E

Shortest Remaining Time(SRT) Pre-emptive version of SPN. Check when a new process enters the system and when the current process voluntarily releases the processor. Better response time as short jobs given immediate preference. Fewer process switches than RR. Must keep track of elapsed time.

Process Scheduling Example

Shortest Remaining Time(SRT) A B C D E

Round robin Pre-empt a process using the clock interrupt. A process is allowed to run for a time-slice or quantum. The next process in the Ready queue is selected to run following the pre-emption (FCFS). Prevents large processes from monopolizing the processor.

Round robin Design issue: length of quantum Short quantum short processes will finish quickly. lots of process switches Choose such that typical processes can complete without being interrupted.

Round robin Unfair to I/O-bound processes as they will typically not use a complete quantum, while CPU-bound processes will. Use Virtual Round Robin Use an auxiliary queue to hold processes that have I/O requests serviced. Process in auxiliary queue gets preference over those in the main ready queue. Process from the auxiliary runs for time remaining from last time-slice.

Process Scheduling Example

Round-Robin A B C D E

Highest Response Ratio Next (HRRN) w – time spent waiting for the processor s – expected service time

HRRN Non-pre-emptive Select the process that has the highest response ratio. Short process (small “s”) given preference. Long process(large “s”) that has been waiting a long time (large “w”) is given preference. Accounts for age of process. Must estimate “s”.

Process Scheduling Example

Highest Response Ratio Next (HRRN) A B C D E

Multi-level Feedback (quantum = i) Pre-emptive (time quantum) Maintain many ready queues of varying priority. Each queue uses FCFS. A process that is pre-empted is moved to a queue of lower priority to wait. Thus longer processes are penalized. Don’t have to estimate running time. Note: If there are no processes waiting, don’t pre- empt the process

Process Scheduling Example

Multi-level Feedback (quantum = i) A B C D E

Multi-level Feedback (quantum = 2 i * quantum) With quantum = i, long processes will have very high turn-around time. So, a process in queue RQi will be allowed to run for 2 i * quantum.

Multi-level Feedback (quantum = 2 i * quantum)

Fair-Share Scheduling Treat multiple processes and threads of a user as a collection. The performance of the collection of threads is optimized not just that of any one thread or process. Fair share scheduling ensures that users are given a fair share of the processor time.

FSS Divide user community into groups. Each user process’ priority is based on the process’ execution time and the execution time of processes within the same group.