Scanf n, a, b /* I-O wait */ for (i=1; i<=n; i++) /* CPU burst */ x = x + a*b; printf x /* I-O wait */ for (i=1; i<=n; i++) /* CPU burst */ x = x + a*b;

Slides:



Advertisements
Similar presentations
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Advertisements

 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Scheduling Algorithms
CPU Scheduling Algorithms
Chapter 3: CPU Scheduling
02/06/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
02/04/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
6/25/2015Page 1 Process Scheduling B.Ramamurthy. 6/25/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-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.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
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.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Chapter 6 CPU SCHEDULING.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
CPU S CHEDULING Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
CPU Scheduling Algorithms Simulation using Java Kaushal Sinha CSC 4320 Spring 2007.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: Process Scheduling.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.
Process Control Management
CS340d: Operating Systems
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Purpose of Operating System Part 2 Monil Adhikari.
Process CPUArrival Time P P2 3 0 P3 3 0 The Gantt Chart for the schedule is: Waiting time for P1 = (7-7)=0; P2 = (0-0)=0; P3 = (3-0)
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CPU Scheduling CS Introduction to Operating Systems.
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
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
 In a single-processor system, only one process can run at a time; any others must wait until the CPU is free and can be rescheduled.  The objective.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
CPU Scheduling CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
Scheduling (Priority Based)
CPSC 457 Operating Systems
CPU Scheduling.
Chapter 6: CPU Scheduling
Operating System Concepts
Exercise Ms.Reema alOraini
Chapter 5: CPU Scheduling
Processor Scheduling Hank Levy 1.
CPU SCHEDULING CPU SCHEDULING.
Prof. Deptii Chaudhari.
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

scanf n, a, b /* I-O wait */ for (i=1; i<=n; i++) /* CPU burst */ x = x + a*b; printf x /* I-O wait */ for (i=1; i<=n; i++) /* CPU burst */ x = x + a*b; printf x /* I-O wait */ waiting time Sum of periods spent waiting in ready queue Average is across all visits to ready queue Goal: short waiting time

 First-Come, First-Served is simplest scheduling algorithm  Ready queue is a FIFO queue: First-In, First- Out  Nonpreemptive : executes until voluntarily gives up CPU  Problems.

 Assume processes arrive in this order: P1, P2, P3  Nonpreemptive scheduling Gantt chart  Average waiting time: ( )/3 = 17 ms PIDBurst P124 P23 P33 P1P2P3

 Assume processes arrive in this order: P2, P3, P1  Nonpreemptive scheduling Gantt chart  Average waiting time: (6+0+3)/3 = 3 ms PIDBurst P23 P33 P124 P2P3P1

 Shortest -Job- First  Assume the next burst time of each process is known  SJF selects process which has the shortest burst time  Nonpreemptive or preemptive(Not included in the course project)  Shortest-remaining-time-first  Interrupts running process if a new process enters the queue  new process must have shorter burst than remaining time

 Assume all processes arrive at the same time: P1, P2, P3, P4  Nonpreemptive scheduling Gantt chart  Average waiting time: ( )/4=7 ms PIDBurst P16 P28 P37 P43 P1P3P2

 Switch between processes  Time quantum is a small unit of time (10 to 100 ms)  Process is executed on the CPU for at most one time quantum  Implemented by using the ready queue as a circular queue  Head process gets the CPU  Uses less than a time quantum IMPLIES gives up the CPU voluntarily  Uses full time quantum IMPLIES timer will cause an interrupt  Context switch will be executed  Process will be put at the tail of queue

 Assume processes arrive in this order: P1, P2, P3  Preemptive scheduling  Time quantum : 4 ms Gantt chart  P1 uses a full time quantum; P2, P3 use only a part of a quantum  P1 waits 0+6=6; P2 waits 4; P3 waits 7  Average waiting time: (6+4+7)/3=5.66 ms PIDBurst P124 P23 P33 P1P2P3P1

Process Scheduling Simulator