Ceng 334 - Operating Systems 2.2-1 Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.

Slides:



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

Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
A. Frank - P. Weisberg Operating Systems Advanced CPU Scheduling.
Operating Systems Chapter 6
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
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
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs. Nonpreemptive Scheduling 8.4Priorities 8.5Scheduling Objectives.
Scheduling in Batch Systems
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (2) Process Management 10/03/2008 Yang Song (Prepared by Yang Song and.
Chapter 5-CPU Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
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
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.
Lecture 5: Uniprocessor Scheduling
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Chapter 9 Uniprocessor Scheduling Spring, 2011 School of Computer Science & Engineering Chung-Ang University.
Chapter 6 CPU SCHEDULING.
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)
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
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.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
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.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Uniprocessor Scheduling
CPU Scheduling Chapter 5.
Chapter 8 – Processor Scheduling
Uniprocessor Scheduling
Chapter 2.2 : Process Scheduling
Process Scheduling B.Ramamurthy 9/16/2018.
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
TDC 311 Process Scheduling.
Chapter 9 Uniprocessor Scheduling
Uniprocessor scheduling
Scheduling 21 May 2019.
Uniprocessor Scheduling
Presentation transcript:

Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads

Ceng Operating Systems Scheduling Select process(es) to run on processor(s) Process state is changed from “ready” to “running” The component of the OS which does the scheduling is called the scheduler

Ceng Operating Systems Types of Scheduling Scheduling is divided into various levels. These levels are defined by the location of the processes A process can be –available to be executed by the processor –partially or fully in main memory –in secondary memory –is not started yet

Ceng Operating Systems Types of Scheduling Long Term Scheduling. –The decision to add to the pool of processes to be executed. Medium Term Scheduling. –The decision to add to the process in main memory. Short Term Scheduling. –The decision as to which process will gain the processor. I/O Scheduling. –The decision as to which process's I/O request shall be handled by a device.

Ceng Operating Systems Scheduling Criteria Fairness : each process should get a fair share of the CPU Efficiency: keep CPU 100% utilized Response time : should be minimized for interactive users Turnaround : minimize batch turnaround times Throughput : maximize number of jobs processed per hour

Ceng Operating Systems User-Oriented, Performance Criteria CriteriaAim Response Timelow response time, maximum number of interactive users Turnaround Timetime between submission and completion Deadlinesmaximise deadlines met

Ceng Operating Systems System-oriented, Performance Criteria CriteriaAim Throughputallow maximum number of jobs to complete Processormaximise percentage of time processor is busy utilisation Overheadminimise time processor busy executing OS

Ceng Operating Systems System oriented, other criteria CriteriaAim Fairnesstreat processes the same avoid starvation Enforcing Prioritiesgive preference to higher priority processes Balancing Resourceskeep the system resources busy

Ceng Operating Systems Important Factors I/O boundedness of a process CPU boundedness of a process Is the process interactive or batch? Process priority Page fault frequency Preemption frequency Execution time received Execution time required to complete

Ceng Operating Systems Types of Scheduling A scheduling algorithm is non-premptive (run to completion) if the CPU cannot be taken away by the OS. A scheduling algorithm is preemptive if the CPU can be taken away by the OS.

Ceng Operating Systems The Interrupting Clock The OS sets the interrupting clock to generate an interrupt at some specified future time. This interrupt time is the process quantum. Provides reasonable response times and prevents the system being held up by processes in infinite loops.

Ceng Operating Systems Scheduling Algorithms FCFS Round Robin Virtual Round Robin Priority Priority Classes Shortest Job First Shortest Remaining Time Highest Response Ratio Next Feedback Queues

Ceng Operating Systems FCFS (First Come First Serve) Implementation: –As each process becomes ready, it joins the ready queue. –When the current process finishes the oldest process is selected next. Characteristics: –Simple to implement –Nonpremptive –Penalises short and I/O-bound processes

Ceng Operating Systems Round Robin (RR) Implementation: –Processes are dispatched FIFO. But are given a fixed time on the CPU (quantum - time slice). Characteristics: –Preemptive –Effective in time sharing environments –Penalises I/O bound processes

Ceng Operating Systems Quantum Size Some Options: –Large or small quantum –Fixed or variable quantum –Same for everyone or different –If quantum is to large RR degenerates into FCFS –If quantum is to small context switching becomes the primary job being executed A good guide is quantum should be slightly larger than the time required for a typical interaction

Ceng Operating Systems Virtual Round Robin (VRR) A modification to the RR algorithm to remove the bias towards CPU bound processes. Implementation: –Two “ready” queues, one called an AUX queue for storing “completed” IO processes –AUX queue has priority over READY queue –IO processes only runs for remaining tim e Characteristics: –Performance studies indicate fairer than RR

Ceng Operating Systems Priority Implementation: –Each process is assigned a priority and the scheduler always selects the highest priority process first Characteristics: –High priority processes may run indefinitely, so decrease the priority of these processes at regular intervals –Assign high priority to system processes with known characteristics such as being I/O bound

Ceng Operating Systems Priority Classes Priority Class 4 Priority Class 2 Priority Class 1 Priority Class 3 Highest Lowest

Ceng Operating Systems Implementation: –Processes are grouped into priority classes –Round Robin is used within a class –When selecting process start with the highest class. If the class is empty, use a lower class Characteristics: –If priorities are not adjusted from time to time, lower classes may starve to death

Ceng Operating Systems Shortest-Job-First (SJF) Sometimes known as Shortest Process Next (SPN) Implementation: –The process with the shortest expected execution time is given priority on the processor

Ceng Operating Systems Characteristics: –Nonpremptive –Reduces average waiting time over FIFO –Always produces the minimum average turnaround time –Must know how long a process will run –Possible user abuse –Suitable for batch environments. Not useful in a timesharing environment

Ceng Operating Systems Shortest Remaining Time (SRT) Preemptive counterpart of SPN Implementation: –Process with the smallest estimated run- time to completion is run next –A running process may be preempted by a new process with a shorter estimate run- time

Ceng Operating Systems Characteristics: –Still requires estimates of the future –Higher overhead than SJF –No additional interrupts are generated as in RR –Elapsed service times must be recorded

Ceng Operating Systems Highest Response Ratio Next (HRRN) How do you get around the problem of Indefinite postponement? Implementation: –Once a job gets the CPU it runs it to completion –The priority of a job is a function of the job's service time and the time it has been waiting for service priority = (time waiting + service time) / service time

Ceng Operating Systems Characteristics: –Nonpremptive –Shorter jobs still get preference over longer jobs –However aging ensures long jobs will eventually gain the processor –Estimation still involved

Ceng Operating Systems Feedback Queues Sometimes called multi-level feedback queues Implementation: –There is a network of ready queues –A new process enters at the top queue –Moves through the queue FIFO

Ceng Operating Systems I/O processes: –If the job requires I/O before quantum expiration it leaves the network and comes back at the same level queue CPU bound processes: –If the quantum expires first, the process is placed on the next lower queue –This continues until it reaches the bottom queue

Ceng Operating Systems Dispatching: –A process is only placed on the CPU if all higher level queues are empty –A running process is preempted by a process arriving in a higher queue –Processes from lower level queues receive a larger quantum Modifications: –In some systems processes can proceed back up the network by becoming I/O bound

Ceng Operating Systems A Scheduling Mechanism Should: Favour short jobs Favour I/O bound jobs to get good I/O device utilisation Determine the nature of a job and schedule accordingly