COSC243 Part 2: Operating Systems

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "COSC243 Part 2: Operating Systems"

Transcription

1 COSC243 Part 2: Operating Systems Lecture 17: CPU Scheduling Zhiyi Huang Dept. of Computer Science, University of Otago Zhiyi Huang (Otago) COSC243 Lecture 17 1 / 30

2 Overview Last lecture: Cooperating Processes and Data-Sharing This lecture: Criteria for Scheduling Algorithms Some Scheduling Algorithms: first-come-first-served, shortest-job-first, priority scheduling, round-robin scheduling, multilevel queue scheduling Note: you will have a TUTORIAL EXAM on CPU scheduling in tutorial 11A (16-17 May). It s worth 10%. The questions in Tutorial 10A are practice for this exam. Zhiyi Huang (Otago) COSC243 Lecture 17 2 / 30

3 CPU Scheduling: A Recap A CPU scheduler is the kernel process which determines how to move processes between the ready queue and the CPU. ready queue CPU I/O I/O I/O device queue I/O device queue Child executes I/O request made fork a child interrupt occurs wait for an interrupt time slice expired Zhiyi Huang (Otago) COSC243 Lecture 17 3 / 30

4 Context Switching When the operating system switches between processes, it has a fair amount of housekeeping to do. This housekeeping is known as context switching. Process P0 Operating System Process P1 executing Interrupt or system call save state into PCB0 idle idle reload state from PCB1 Interrupt or system call executing executing Save state into PCB1 Reload state from PCB0 idle Zhiyi Huang (Otago) COSC243 Lecture 17 4 / 30

5 Terminology: Scheduler and Dispatcher The scheduler decides which process to give to the CPU next, and when to give it. Its decisions are carried out by the dispatcher. Dispatching involves Switching context Switching to user mode Jumping to the proper location in the new program. Dispatch latency: the time it takes the dispatcher to do this. Zhiyi Huang (Otago) COSC243 Lecture 17 5 / 30

6 Why Do We Want a Scheduler? (1) One key motivation behind CPU scheduling is to keep the CPU busy. This means removing processes from the CPU while they re waiting. If processes never had to wait, then scheduling wouldn t increase CPU utilisation. However, it s a fact about processes that they tend to exhibit a CPU burst cycle. CPU burst I/O burst CPU burst I/O burst Zhiyi Huang (Otago) COSC243 Lecture 17 6 / 30

7 How Long is a CPU Burst? This is the kind of frequency curve we can expect: frequency CPU burst duration (ms) Zhiyi Huang (Otago) COSC243 Lecture 17 7 / 30

8 Why Do We Want a Scheduler? (2) Another reason for having a scheduler is so that processes don t have to spend too much time waiting for the CPU. Even if the CPU is always busy, executing processes in different orders can change the average amount of time a process spends queueing for the CPU. Total CPU time needed P1 P2 P3 P4 Zhiyi Huang (Otago) COSC243 Lecture 17 8 / 30

9 Why Do We Want a Scheduler? (3) Another reason for having a scheduler is so that interactive processes always respond quickly. One question is how long a process spends waiting for the CPU in total; A different question is how long on average it waits in between visits to the CPU. (Important for interactive processes.) Fast CPU switching P1 P2 P1 P2 P1 P2 P1 P2 time Slower CPU switching P1 P2 P1 P2 Zhiyi Huang (Otago) COSC243 Lecture 17 9 / 30

10 Criteria for Scheduling Algorithms CPU utilisation: the percentage of time that the CPU is busy. Throughput: the number of processes that are completed per time unit. Turnaround time (for a single process): the length of time from when the process was submitted (arrived) to when it is completed. Waiting time (for a single process): the total amount of time the process spends waiting for the CPU. Response time (for a single process): the average time from the submission of a request to a process until the first response is produced. Zhiyi Huang (Otago) COSC243 Lecture / 30

11 Terminology: The Ready Queue head process ID number pointer process state process ID number pointer process state process ID number pointer process state program counter program counter program counter tail Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Accounting information Accounting information Accounting information Remember: there are two kinds of waiting: Waiting for the CPU (in the ready queue); Waiting for an I/O device (in a device queue). Don t be confused when you hear about processes waiting in the ready queue! Zhiyi Huang (Otago) COSC243 Lecture / 30

12 Terminology: Preemption There are 4 situations for scheduling decisions to take place: 1 a process switches from running to waiting state; 2 a process switches from running to ready (due to an interrupt); 3 a process switches from waiting to ready state (due to completion of I/O); 4 a process terminates. In a non-preemptive scheduling system, scheduling takes place only under 1 and 4, which has no choice. In a preemptive scheduling system, scheduling can take place under 2 and 3 as well. Zhiyi Huang (Otago) COSC243 Lecture / 30

13 Implementing a Preemptive System Implementing preemption is hard. What if a process is preempted while a system call is being executed? Kernel data e.g. I/O queues might be left in an inconsistent state. Earlier versions of UNIX dealt with this problem by waiting until system calls were completed before switching context. Some systems: MS Windows 3.1 and below is nonpreemptive. Windows 95, NT, XP etc are preemptive. Linux is fully preemptive as of 2.6. Zhiyi Huang (Otago) COSC243 Lecture / 30

14 1) First-Come-First-Served Scheduling The simplest method is to execute the processes in the ready queue on a first-come-first-served (FCFS) basis. head process ID number pointer process state process ID number pointer process state process ID number pointer process state program counter program counter program counter tail Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Accounting information Accounting information Accounting information When a process becomes ready, it is put at the tail of the queue. When the currently executing process terminates, or waits for I/O, the process at the front of the queue is selected next. This algorithm is non-preemptive. Zhiyi Huang (Otago) COSC243 Lecture / 30

15 Gantt Charts The operation of a scheduling algorithm is commonly represented in a Gantt chart. Consider the following process information: Process Arrival Time Burst Time P P2 1 3 P3 2 3 (N.B. We re just looking at the initial CPU burst for each process.) The Gantt chart for FCFS with the above data is: P1 P2 P Zhiyi Huang (Otago) COSC243 Lecture / 30

16 Gantt Charts for Algorithm Evaluation Process Arrival Time Burst Time P P2 1 3 P3 2 3 P1 P2 P Waiting times: P1? 0MS P2? 24-1 = 23MS P3? 27-2 = 25MS Average Waiting Time? ( )/3MS = 16MS Zhiyi Huang (Otago) COSC243 Lecture / 30

17 Gantt Charts for Algorithm Evaluation Process Arrival Time Burst Time P P2 0 3 P3 1 3 P2 P3 P Waiting times: P1? 6-2 = 4MS P2? 0MS P3? 3-1 = 2MS Average Waiting Time? (4+0+2)/3MS = 2MS. Zhiyi Huang (Otago) COSC243 Lecture / 30

18 FCFS: Advantages and Disadvantages ADVANTAGES: EASY TO IMPLEMENT. EASY TO UNDERSTAND. DISADVANTAGES: WAITING TIME NOT LIKELY TO BE MINIMAL. CONVOY EFFECT: LOTS OF SMALL PROCESSES CAN GET STUCK BEHIND ONE BIG ONE. Q: COULD THROUGHPUT (NO OF PROCESSS PER TIME UNIT GOING THROUGH THE SYSTEM) BE IMPROVED? BAD RESPONSE TIME. (SO BAD FOR TIME-SHARING SYSTEMS). Zhiyi Huang (Otago) COSC243 Lecture / 30

19 2) Shortest-Job-First Scheduling If we knew in advance which process on the list had the shortest burst time, we could choose to execute that process next. This method is called shortest-job-first (SJF) scheduling. Example: Process Burst Time P1 6 P2 8 P3 7 P4 3 P4 P1 P3 P N.B. processes with equal burst times are executed in FCFS order. Zhiyi Huang (Otago) COSC243 Lecture / 30

20 SJF: Advantages and Disadvantages ADVANTAGES: PROVABLY OPTIMAL AVERAGE WAITING TIME. DISADVANTAGES: YOU NEVER KNOW IN ADVANCE WHAT THE LENGTH OF THE NEXT CPU BURST IS GOING TO BE. POSSIBILITY OF LONG PROCESSES NEVER GETTING EXECUTED? Zhiyi Huang (Otago) COSC243 Lecture / 30

21 Predicting the next CPU burst length It s possible to approximate the length of the next CPU burst: it s likely to be similar in length to the previous CPU bursts. A commonly-used formula: the exponential average CPU burst length. τ n+1 = α t n + (1 α)τ n τ n : the predicted length of CPU burst n. t n : the actual length of CPU burst n. α: a value between 0 and 1. Zhiyi Huang (Otago) COSC243 Lecture / 30

22 Preemption and SJF Scheduling Scenario: - A process P1 is currently executing. - A new process P2 arrives before P1 is finished. - P2 s burst time is shorter than the remaining burst time of P1. Non-preemptive SJF: P1 keeps the CPU. Preemptive SJF: P2 takes the CPU. Tiny example: Process Arrival Time Burst Time P1 0 8 P2 1 4 P1 P2 P Zhiyi Huang (Otago) COSC243 Lecture / 30

23 3) Priority Scheduling In priority scheduling, each process is allocated a priority when it arrives; the CPU is allocated to the process with highest priority. Priorities are represented by numbers, with low numbers being highest priority. Can priority scheduling be preemptive? YES, NO REASON WHY NOT. What s the relation of SJF scheduling to priority scheduling? SJF IS A TYPE OF PRIORITY SCHEDULING. (SPECIFICALLY, ONE WHERE THE PRIORITY OF A PROCESS IS SET TO BE THE ESTIMATED NEXT CPU BURST. (IF LOW NUMBERS ARE ASSUMED TO DENOTE HIGH PRIORITIES.) Zhiyi Huang (Otago) COSC243 Lecture / 30

24 Starvation and Aging Starvation occurs when a process waits indefinitely to be allocated the CPU. Priority scheduling algorithms are susceptible to starvation. Imagine a process P1 is waiting for the CPU, and a stream of higher-priority processes is arriving. If these processes arrive sufficiently fast, P1 will never get a chance to execute. A solution to the starvation problem is to increase the priority of processes as a function of how long they ve been waiting for the CPU. (Called aging.) Zhiyi Huang (Otago) COSC243 Lecture / 30

25 4) Round-Robin Scheduling Round-robin (RR) scheduling is designed for time-sharing systems. A small unit of time (time quantum) is defined. The ready queue is treated as a circular list. The CPU scheduler goes round the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum. head process ID number pointer process state process ID number pointer process state process ID number pointer process state program counter program counter program counter tail Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Contents of CPU registers memory management information I/O status information Accounting information Accounting information Accounting information CPU I/O operation? Time quantum expired? Zhiyi Huang (Otago) COSC243 Lecture / 30

26 An example of Round-Robin Say we have an RR algorithm with a quantum of 3, and the following process info: The Gannt chart will look like this: Process Arrival Time Burst Time P1 0 8 P2 1 4 P3 4 4 P2=0 P3=0 P1=5 P2=1 P1=2 P3=1 P1=0 P1 P2 P1 P3 P2 P1 P Note: in RR it s possible that a process re-enters the ready queue at the same time that another process arrives in the queue. We ll use FCFS as a tie-breaker here too. Zhiyi Huang (Otago) COSC243 Lecture / 30

27 Changing the Time Quantum in RR Scheduling If the time quantum is set to be infinitely large: RR scheduling reduces to FCFS scheduing. If the time quantum is set to be very small: we can talk of processor sharing. However, there are drawbacks to making the time quantum very small. Let s say we make the time quantum the same as the context switch time. Then we ll spend half our time on context switching! Zhiyi Huang (Otago) COSC243 Lecture / 30

28 RR: Advantages and Disadvantages IT ALL DEPENDS ON THE SIZE OF THE TIME QUANTUM. IF IT S BIG, WE GET THE ADVANTAGES/DISADVANTAGES OF FCFS SCHEDULING. IF IT S VERY SMALL, WE GET FASTER RESPONSE TIME. BUT SLOWER THROUGHPUT. (WHY? BECAUSE THERE S MORE TIME SPENT CONTEXT-SWITCHING.) EVEN IF YOU IGNORE CONTEXT-SWITCH TIME, TURNAROUND TIME GOES DOWN IF MOST PROCESSES COMPLETE WITHIN A SINGLE QUANTUM. FOR INSTANCE, SAY THERE ARE 3 PROCESSES WITH A NEXT CPU BURST OF 10. IF THE QUANTUM SIZE IS 1, THEN AVERAGE TURNAROUND TIME IS 29. BUT IF QUANTUM SIZE IS 10, THEN THEY DO FINISH IN THE NEXT CPU BURST, AND THE AVERAGE TURNAROUND TIME IS 20. IF WE TAKE CONTEXT-SWITCH TIME INTO ACCOUNT, MAKING THE TIME QUANTUM SMALL ALSO HAS THE EFFECT OF INCREASING TURNAROUND TIME. Zhiyi Huang (Otago) COSC243 Lecture / 30

29 5) Multilevel Queue Scheduling Let s say you have two groups of processes: interactive processes; batch processes. What you really want is to run different scheduling algorithms for the two different groups. Multilevel queue scheduling: Split the ready queue into a number of different queues, each with its own scheduling algorithm. Implement a scheduling algorithm to decide which queue is next allocated. (Preemptive priority scheduling is often used.) Zhiyi Huang (Otago) COSC243 Lecture / 30

30 Exercises For this lecture, you should have read Chapter 5 (Sections 1, 2, 3 and 7) of Silberschatz et al. For next lecture: 1 Read Chapter 6 (Sections 1 7). 2 The Unix command nice can be used to run processes at different priorities. Read the man page for nice. Using one of the programs you have written on UNIX, try the following: /bin/nice -n 19 [program] /bin/nice -n 10 [program] Notice any difference in speed? Zhiyi Huang (Otago) COSC243 Lecture / 30

Lecture 5 CPU Scheduling

Lecture 5 CPU Scheduling Lecture 5 CPU Scheduling (Uniprocessor System) 1 Lecture Contents 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 2 Switching CPU among processes in multiprogrammed OSs makes a computer

More information

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Operating System Concepts 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle

More information

Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler

Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler CPU Scheduling Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler Short-term scheduler Ready queue may be a FIFO queue, priority queue, tree, linked list, etc.

More information

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts Basic Concepts P CPU Scheduling CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating

More information

Module 5: CPU Scheduling

Module 5: CPU Scheduling Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Operating System Concepts 5.1 Silberschatz and

More information

Process Scheduling. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Process Scheduling. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University. Process Scheduling Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Basic Concepts Scheduling Criteria Scheduling Algorithms Windows NT Scheduler Topics Covered

More information

Chapter 6 Process Scheduling

Chapter 6 Process Scheduling 1 Chapter 6 Process Scheduling CPU scheduling deals with the problem of deciding which of the processes in the ready queue is to be allocated the CPU. There are many different CPU-scheduling algorithms.

More information

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University CS 571 Operating Systems CPU Scheduling Angelos Stavrou, George Mason University CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms First-Come-First-Served Shortest-Job-First, Shortest-remaining-Time-First

More information

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples Java Thread Scheduling Algorithm

More information

CPU Scheduling CS 571. CPU - I/O Burst Cycle. Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process

CPU Scheduling CS 571. CPU - I/O Burst Cycle. Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process CPU Scheduling CS 571 1 CPU - I/O Burst Cycle Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process 2 1 Basic Concepts CPU I/O Burst Cycle Process execution consists

More information

multiple processes are kept in memory simultaneously when one process is waiting, another process executes

multiple processes are kept in memory simultaneously when one process is waiting, another process executes Terminology. Reference: Section 4.2, 5.1 Time-sharing / multiprogramming Typical proc. alternates between CPU bursts and I/O bursts To maximize CPU utilization: multiple processes are kept in memory simultaneously

More information

Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms

Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms Lecture Overview Introduction to process scheduling Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms First-come, first-serve Shortest-job-first Priority Round-robin

More information

CS420: Operating Systems

CS420: Operating Systems CPU Scheduling James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Scheduling Concepts

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 2 Basic Concepts Maximum CPU utilization

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

Chapter 6: CPU Scheduling. Basic Concepts

Chapter 6: CPU Scheduling. Basic Concepts 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

More information

CPU Scheduling. Date. 2/2/2004 Operating Systems 1

CPU Scheduling. Date. 2/2/2004 Operating Systems 1 CPU Scheduling Date 2/2/2004 Operating Systems 1 Basic concepts Maximize CPU utilization with multi programming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

More information

Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation

Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 1 Basic Concepts Maximum CPU utilization obtained

More information

Chapter 5: Process Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: Process Scheduling. Operating System Concepts 8 th Edition, Chapter 5: Process Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Edited by Ghada Ahmed, PhD ghada@fcih.net Silberschatz, Galvin and Gagne 2013 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

More information

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

KSU/CCIS CSC227 Tutorial # 4 CPU Scheduling SUMMER

KSU/CCIS CSC227 Tutorial # 4 CPU Scheduling SUMMER KSU/CCIS CSC227 Tutorial # 4 CPU Scheduling SUMMER - 2010 Question # 1: Select the most appropriate answer for each of the following questions: 1. is the number of processes that complete their execution

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition,

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition, Chapter 6: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Chapter 6: 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming.

More information

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts Previous Lectures Multithreading Memory Layout Kernel vs User threads Representation in OS Difference between thread and process Thread scheduling Mapping between user and kernel threads Multithreading

More information

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms!

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! First-Come-First-Served! Shortest-Job-First, Shortest-remaining-Time-First! Priority Scheduling! Round Robin! Multi-level Queue!

More information

Module 6: CPU Scheduling. Basic Concepts

Module 6: CPU Scheduling. Basic Concepts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Silberschatz,

More information

CPU Scheduling. Chapter 5

CPU Scheduling. Chapter 5 CPU Scheduling Chapter 5 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

More information

CS720 - Operating Systems. CPU Scheduling

CS720 - Operating Systems. CPU Scheduling CS720 - Operating Systems CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Procesor Scheduling Real-Time Scheduling Algorithm Evaluation Slides derived from material in

More information

Operating Systems Fall 2012 Lecture 4: CPU Scheduling

Operating Systems Fall 2012 Lecture 4: CPU Scheduling 482000000000357 Operating Systems Fall 2012 Lecture 4: CPU Scheduling Assist. Prof. Ediz ŞAYKOL ediz.saykol@beykent.edu.tr Operating System - Main Goals Interleave the execution of the number of processes

More information

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University EECS 3221 Operating System Fundamentals No.4 CPU scheduling Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University CPU Scheduling CPU scheduling is the basis of multiprogramming

More information

Types of jobs. CPU-bound vs. I/O-bound. Batch, Interactive, real time. Maximum CPU utilization obtained with multiprogramming

Types of jobs. CPU-bound vs. I/O-bound. Batch, Interactive, real time. Maximum CPU utilization obtained with multiprogramming CPU Scheduling Types of jobs CPU-bound vs. I/O-bound Maximum CPU utilization obtained with multiprogramming Batch, Interactive, real time Different goals, affects scheduling policies CPU Scheduler Selects

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling! Chapter 5: CPU Scheduling Operating System Concepts 8 th Edition, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling

More information

CPU Scheduling. Multiprogrammed OS

CPU Scheduling. Multiprogrammed OS CPU Scheduling Multiprogrammed OS Efficient Use of Processor By switching between jobs Thread scheduling and process scheduling often used interchangeably Which is done depends on implementation of O/S.

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various scheduling algorithms

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Basic Concepts An OS must allocate resources amongst competing processes The resource

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Linux Example

More information

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process Threads (Ch.4)! Many software packages are multi-threaded l Web browser: one thread display images, another thread retrieves data from the network l Word processor: threads for displaying graphics, reading

More information

Agenda. CPU Scheduling. Types of Resources. Non-preemptible Resources. Resources can be classified into one of two groups. - non-preemptible resources

Agenda. CPU Scheduling. Types of Resources. Non-preemptible Resources. Resources can be classified into one of two groups. - non-preemptible resources genda Scheduling SI 444/544 Operating Systems Fall 8 What is scheduling? scheduling vs. allocation Scheduling criteria Scheduling algorithms What are FFS, SJF, RR and priority-based scheduling policies?

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling 1.1 Maximum CPU utilization obtained with multiprogramming CPU I/O Burst

More information

Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts Chapter 6: CPU Scheduling Basic Concepts Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Maximum CPU utilization obtained

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Oct-03 1 Basic Concepts Maximum CPU utilization

More information

CHAPTER 5 Exercises 5.1 Answer: 5.2 Answer: 5.3 lottery scheduling

CHAPTER 5 Exercises 5.1 Answer: 5.2 Answer: 5.3 lottery scheduling CHAPTER 5 CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive. In this chapter, we introduce

More information

Objectives. Concepts (2) Scheduler and interrupts. Concepts (1) Bursts

Objectives. Concepts (2) Scheduler and interrupts. Concepts (1) Bursts Objectives Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Lecture 4: Process scheduling To introduce process scheduling algorithms Non-priority based Priority based Examine

More information

Describe various CPU-scheduling algorithms. Describe various multi- processor CPU-scheduling algorithms

Describe various CPU-scheduling algorithms. Describe various multi- processor CPU-scheduling algorithms CPU Scheduling Objectives Describe various CPU-scheduling algorithms Describe various multi- processor CPU-scheduling algorithms To discuss evaluation criteria for selecting a CPUscheduling algorithm for

More information

CPU Scheduling: Basic Concepts

CPU Scheduling: Basic Concepts CPU Scheduling: Basic Concepts Idea: Maximum CPU utilization obtained with multiprogramming" CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait" Dispatcher grants CPU

More information

CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler

CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler CPU scheduling Alternating Sequence of CPU And I/O Bursts Maximum CPU utilization is obtained by multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

More information

Announcements Project #2. Basic Concepts

Announcements Project #2. Basic Concepts Announcements Project #2 Is due at 6:00 PM on Friday Program #3 Posted tomorrow (implements scheduler) Reading Chapter 6 Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU

More information

CSC 539: Operating Systems Structure and Design. Spring 2006

CSC 539: Operating Systems Structure and Design. Spring 2006 CSC 539: Operating Systems Structure and Design Spring 2006 CPU scheduling historical perspective CPU-I/O bursts preemptive vs. nonpreemptive scheduling scheduling criteria scheduling algorithms: FCFS,

More information

CPU Scheduling. CPU Scheduling

CPU Scheduling. CPU Scheduling CPU Scheduling Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

CPU Scheduling. Schedulers

CPU Scheduling. Schedulers Schedulers Structure of a scheduler Criteria for scheduling Scheduling Algorithms FCFS SPN SRT MLFQ scheduling in Unix Schedulers start long-term scheduler short-term scheduler suspended ready ready running

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

More information

Lecture 5- CPU Scheduling

Lecture 5- CPU Scheduling Lecture 5- CPU Scheduling Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 17 Lecture Outline CPU Scheduling

More information

Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition Chapter 5: Process Scheduling Operating System Concepts with Java 8 th Edition 5.1 Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

More information

Introduction to Scheduling 1

Introduction to Scheduling 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms FCFS, SJF, RR Exponential Averaging Multi-level Queue Scheduling Performance Evaluation Scheduling Terminology Scheduling Terminology

More information

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Based on original slides by Silberschatz, Galvin and Gagne 1 Basic Concepts CPU I/O Burst Cycle Process execution

More information

CS416 CPU Scheduling

CS416 CPU Scheduling CS416 CPU Scheduling CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers University Rutgers Sakai: 01:198:416 Sp11 (https://sakai.rutgers.edu) Assumptions Pool of jobs

More information

PROCESS SCHEDULING. CS124 Operating Systems Winter 2013-2014, Lecture 12

PROCESS SCHEDULING. CS124 Operating Systems Winter 2013-2014, Lecture 12 PROCESS SCHEDULING CS124 Operating Systems Winter 2013-2014, Lecture 12 2 Process Scheduling OSes must manage the allocation and sharing of hardware resources to applications that use them Most important

More information

III. Process Scheduling

III. Process Scheduling Intended Schedule III. Process Scheduling Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

More information

III. Process Scheduling

III. Process Scheduling III. Process Scheduling 1 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

More information

CPU Scheduling. Operating System Concepts. Alternating Sequence of CPU And I/O Bursts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times

CPU Scheduling. Operating System Concepts. Alternating Sequence of CPU And I/O Bursts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times Operating System Concepts Module 5: CPU SCHEDULING Andrzej Bednarski, Ph.D. student Department of Computer and Information Science Linköping University, Sweden CPU Scheduling Basic Concepts Scheduling

More information

Computer Systems II. CPU Scheduling. Review of Process States

Computer Systems II. CPU Scheduling. Review of Process States Computer Systems II CPU Scheduling 1 Review of Process States 2 1 OS Queuing Model Enter Ready queue CPU Exit Disk Queue Network Queue Printer Queue Processes enter and leave the system 3 CPU Scheduling

More information

Silberschatz and Galvin

Silberschatz and Galvin Silberschatz and Galvin Chapter 5 CPU Scheduling CPSC 410--Richard Furuta 01/19/99 1 Topics covered Basic concepts/scheduling criteria Non-preemptive and Preemptive scheduling Scheduling algorithms Algorithm

More information

Processor Scheduling. Background. Scheduling. Scheduling

Processor Scheduling. Background. Scheduling. Scheduling Background Processor Scheduling The previous lecture introduced the basics of concurrency Processes and threads Definition, representation, management We now understand how a programmer can spawn concurrent

More information

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms Chapter 5: Process Scheduling To discuss evaluation criteria for selecting the CPUscheduling algorithm for a particular

More information

Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling! Chapter 5: CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Multiple-Processor Scheduling! Real-Time Scheduling! Algorithm Evaluation! 6.1! Basic Concepts! Long-term scheduler

More information

CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals CSC 271 Software I: Utilities and Internals Lecture 9 : What are Processes? The Process Concept Originally, computers ran only one program at a time, which had total access to all of the computer s resources.

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Operating Systems CMPSC 473. CPU Scheduling February 12, 2008 - Lecture 8 Instructor: Trent Jaeger

Operating Systems CMPSC 473. CPU Scheduling February 12, 2008 - Lecture 8 Instructor: Trent Jaeger Operating Systems CMPSC 473 CPU Scheduling February 12, 2008 - Lecture 8 Instructor: Trent Jaeger Last class: Threads Today: CPU Scheduling Resource Allocation In a multiprogramming system, we need to

More information

Threads & Introduction to CPU Scheduling

Threads & Introduction to CPU Scheduling Threads & Introduction to CPU Scheduling Mohammad S. Hasan Staffordshire University, UK Threads & Introduction to CPU Scheduling Slide 1 Lecture Outline Definition of a thread and types CPU -I/O burst

More information

Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts

Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts TDDB3: Concurrent programming and operating systems [SGG7] Chapter 5 Agenda CPU Scheduling Introduce CPU scheduling Describe various CPU scheduling algorithms Discuss evaluation criteria of CPU scheduling

More information

Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks

Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks Basic Concepts CPU-I/O burst cycle - Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution

More information

Lecture 5 Process Scheduling (chapter 5)

Lecture 5 Process Scheduling (chapter 5) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 5 Process Scheduling (chapter 5) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The slides

More information

Admin. Threads, CPU Scheduling. Yesterday s Lecture: Threads. Today s Lecture. ITS 225: Operating Systems. Lecture 4

Admin. Threads, CPU Scheduling. Yesterday s Lecture: Threads. Today s Lecture. ITS 225: Operating Systems. Lecture 4 ITS 225: Operating Systems Admin Lecture 4 Threads, CPU Scheduling Jan 23, 2004 Dr. Matthew Dailey Information Technology Program Sirindhorn International Institute of Technology Thammasat University Some

More information

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading Announcements Reading Chapter 5 Chapter 7 (Monday or Wednesday) Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution What are the

More information

CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University

CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University CPU Scheduling Yi Shi Fall 2015 Xi an Jiaotong University Goals for Today CPU Schedulers Scheduling Algorithms Algorithm Evaluation Metrics Algorithm details Thread Scheduling Multiple-Processor Scheduling

More information

Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU.

Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU. Chapter 5: Process Scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms To discuss evaluation criteria for selecting the CPU-scheduling algorithm for a particular

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005

Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005 Chapter 5: CPU Scheduling Operating System Concepts 7 th Edition, Jan 14, 2005 Silberschatz, Galvin and Gagne 2005 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

Calculate the average waiting time if the processes arrive in the order of: a). P1, P2, P3

Calculate the average waiting time if the processes arrive in the order of: a). P1, P2, P3 Scheduling Algorithms: 1. First come First Serve: FCFS is the simplest non-preemptive algorithm. Processes are assigned the CPU in the order they request it. That is the process that requests the CPU first

More information

Operating System: Scheduling

Operating System: Scheduling Process Management Operating System: Scheduling OS maintains a data structure for each process called Process Control Block (PCB) Information associated with each PCB: Process state: e.g. ready, or waiting

More information

CS 4410 Operating Systems. CPU Scheduling. Summer 2011 Cornell University

CS 4410 Operating Systems. CPU Scheduling. Summer 2011 Cornell University CS 4410 Operating Systems CPU Scheduling Summer 2011 Cornell University Today How does CPU manage the execution of simultaneously ready processes? Example Multitasking - Scheduling Scheduling Metrics Scheduling

More information

Scheduling I. Introduction to scheduling. Scheduling algorithms

Scheduling I. Introduction to scheduling. Scheduling algorithms Scheduling I Introduction to scheduling Scheduling algorithms 1 Role of Dispatcher vs. Scheduler Dispatcher Low-level mechanism Responsibility: context switch Scheduler High-level policy Responsibility:

More information

Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff

Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff Process Scheduling CS 241 February 24, 2012 Copyright University of Illinois CS 241 Staff 1 Announcements Mid-semester feedback survey (linked off web page) MP4 due Friday (not Tuesday) Midterm Next Tuesday,

More information

ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

More information

CPU scheduling. Kevin Marquet. September INSA Lyon / IF CITI Lab/INRIA Socrate

CPU scheduling. Kevin Marquet. September INSA Lyon / IF CITI Lab/INRIA Socrate CPU scheduling Kevin Marquet INSA Lyon / IF CITI Lab/INRIA Socrate September 2014 CPU-I/O burst CPU burst : process requires CPU execution I/O burst : process waits for I/O completion (CPU-IO burst) (burst

More information

5.1 Basic Concepts. Chapter 5: Process Scheduling. Alternating Sequence of CPU And I/O Bursts. 5.1 Basic Concepts

5.1 Basic Concepts. Chapter 5: Process Scheduling. Alternating Sequence of CPU And I/O Bursts. 5.1 Basic Concepts 5.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution Chapter 5: Process

More information

Process Management Chapter 5 CPU Scheduling

Process Management Chapter 5 CPU Scheduling Part II Process Management Chapter 5 CPU Scheduling Fall 2010 1 CPU-I/O Burst Cycle CPU burst I/O burst CPU burst I/O burst CPU burst I/O burst CPU burst Process execution repeats the CPU burst and I/Ob

More information

Chapter 5 CPU Scheduling

Chapter 5 CPU Scheduling Chapter 5 CPU Scheduling CPU Scheduling 1 Outline! Basic Concepts.! Scheduling Criteria.! Scheduling Algorithms.! Multiple-Processor Scheduling.! Thread Scheduling.! Operating Systems Examples.! Algorithm

More information

Scheduling. Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1

Scheduling. Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Scheduling Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Outline Introduction Types of Scheduling Scheduling Criteria FCFS Scheduling Shortest-Job-First Scheduling Priority

More information

CPU Scheduling. CS439: Principles of Computer Systems September 7, 2016

CPU Scheduling. CS439: Principles of Computer Systems September 7, 2016 CPU Scheduling CS439: Principles of Computer Systems September 7, 2016 Last Time A process is a unit of execution Defines an address space An abstraction for protection Processes are represented as Process

More information

Chapter 5 Process Scheduling

Chapter 5 Process Scheduling Chapter 5 Process Scheduling CPU Scheduling Objective: Basic Scheduling Concepts CPU Scheduling Algorithms Why Multiprogramming? Maximize CPU/Resources Utilization (Based on Some Criteria) CPU Scheduling

More information

Processor-bound program: A program having long processor bursts (execution instants). I/O-bound program: A program having short processor bursts.

Processor-bound program: A program having long processor bursts (execution instants). I/O-bound program: A program having short processor bursts. Chapter 2 Processor Scheduling 2.1 Processes A process is an executing program, including the current values of the program counter, registers, and variables.the subtle difference between a process and

More information

Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Basic Concepts

More information

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus Process Management CS 502 Spring 99 WPI MetroWest/Southboro Campus Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Threads Interprocess Communication 1 1 Process

More information

CPU Scheduling Algorithms

CPU Scheduling Algorithms CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those from the course text Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and Gagne. Many, if not

More information