Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Similar documents
Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Scheduling of processes

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

OPERATING SYSTEM. The Process. Introduction Process creation & termination Process state diagram Process scheduling & its criteria

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

CS3733: Operating Systems

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

Chapter 5: CPU Scheduling

Chapter 9 Uniprocessor Scheduling

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Frequently asked questions from the previous class survey

Last Class: Processes

Uniprocessor Scheduling

Uniprocessor Scheduling. Chapter 9

Unit 3 : Process Management

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

Today s class. Scheduling. Informationsteknologi. Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1

CS370 Operating Systems

Process- Concept &Process Scheduling OPERATING SYSTEMS

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Comp 310 Computer Systems and Organization

Scheduling Bits & Pieces

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Scheduling. The Basics

OPERATING SYSTEMS: Lesson 4: Process Scheduling

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

Chapter 9. Uniprocessor Scheduling

Process Scheduling Part 2

CSE 120 Principles of Operating Systems Spring 2017

Announcements/Reminders

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Processes and Threads

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

Process Concepts 8/21/2014. CS341: Operating System. Scheduling: Theoretical Analysis

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Operating System Concepts Ch. 5: Scheduling

Process Scheduling. Copyright : University of Illinois CS 241 Staff

Operating Systems ECE344. Ding Yuan

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Computer Systems II. First Two Major Computer System Evolution Steps

Operating Systems. Scheduling

Course Syllabus. Operating Systems

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Process Description and Control. Chapter 3

Processes, PCB, Context Switch

CS370 Operating Systems

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

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

Process Description and Control. Chapter 3

Processes and Threads. Processes: Review

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Scheduling in the Supermarket

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

Operating System Review Part

OPERATING SYSTEM SUPPORT (Part 1)

CSE 120 Principles of Operating Systems

CS370 Operating Systems

UNIT 2 PROCESSES 2.0 INTRODUCTION

Introduction. CS3026 Operating Systems Lecture 01

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Scheduling. Scheduling 1/51

Scheduling Mar. 19, 2018

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

A COMPARATIVE STUDY OF CPU SCHEDULING POLICIES IN OPERATING SYSTEMS

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Process Description and Control. Chapter 3

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

Project 2: CPU Scheduling Simulator

8: Scheduling. Scheduling. Mark Handley

Table 9.1 Types of Scheduling

CHAPTER 2: PROCESS MANAGEMENT

CS418 Operating Systems

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

CPU Scheduling: Objectives

Operating Systems. Figure: Process States. 1 P a g e

Ch 4 : CPU scheduling

Process! Process Creation / Termination! Process Transitions in" the Two-State Process Model! A Two-State Process Model!

Properties of Processes

Announcement. Exercise #2 will be out today. Due date is next Monday

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Operating Systems Process description and control

Process Description and Control

So far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

IT 540 Operating Systems ECE519 Advanced Operating Systems

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Scheduling - Overview

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

Scheduling. Scheduling 1/51

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Example: CPU-bound process that would run for 100 quanta continuously 1, 2, 4, 8, 16, 32, 64 (only 37 required for last run) Needs only 7 swaps

Transcription:

Announcements Reading Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) 1

Relationship between Kernel mod and User Mode User Process Kernel System Calls User Process Initial Thread Unique: Program Stack Heap Kernel Mode thread of A user process Idle Thread Unique: Program Stack Heap Kernel Threads: Each has own stack (separate from user mode) Share heap with other kernel threads Run same program (kernel) as other kernel threads 2

Threads processes can be a heavy (expensive) object threads are like processes but generally a collection of threads will share memory (except stack) open files (and buffered data) signals can be user or system level user level: kernel sees one process + easy to implement by users - I/O management is difficult - in an multi-processor can t get parallelism system level: kernel schedules threads 3

Important Terms Threads An execution context sharing an address space Kernel Threads Threads running with kernel privileges User Threads Threads running in user space Processes An execution context with an address space Visible to and scheduled by the kernel Light-Weight Processes An execution context sharing an address space Visible to and scheduled by the kernel 4

Dispatcher The inner most part of the OS that runs processes Responsible for: saving state into PCB when switching to a new process selecting a process to run (from the ready queue) loading state of another process Sometimes called the short term scheduler but does more than schedule Switching between processes is called context switching One of the most time critical parts of the OS Almost never can be written completely in a high level language 5

Selecting a process to run called scheduling can simply pick the first item in the queue called round-robin scheduling is round-robin scheduling fair? can use more complex schemes we will study these in the future use alarm interrupts to switch between processes when time is up, a process is put back on the end of the ready queue frequency of these interrupts is an important parameter typically 3-10ms on modern systems need to balance overhead of switching vs. responsiveness 6

CPU Scheduling Manage CPU to achieve several objectives: maximize CPU utilization minimize response time maximize throughput minimize turnaround time Multiprogrammed OS multiple processes in executable state at same time scheduling picks the one that will run at any give time (on a uniprocessor) Processes use the CPU in bursts may be short or long depending on the job 7

Types of Scheduling At least 4 types: long-term - add to pool of processes to be executed medium-term - add to number of processes partially or fully in main memory short-term - which available process will be executed by the processor I/O - which process s pending I/O request will be handled by an available I/O device Scheduling changes the state of a process 8

Scheduling criteria Per processor, or system oriented CPU utilization maximize, to keep as busy as possible throughput maximize, number of processes completed per time unit Per process, or user oriented turnaround time minimize, time of submission to time of completion. waiting time minimize, time spent in ready queue - affected solely by scheduling policy response time minimize, time to produce first output most important for interactive OS 9

Scheduling criteria non-performance related Per process predictability job should run in about the same amount of time, regardless of total system load Per processor fairness don t starve any processes, treat them all the same enforce priorities favor higher priority processes balance resources keep all resources busy 10

Medium vs. Short Term Scheduling Medium-term scheduling Part of swapping function between main memory and disk based on how many processes the OS wants available at any one time must consider memory management if no virtual memory (VM), so look at memory requirements of swapped out processes Short-term scheduling (dispatcher) Executes most frequently, to decide which process to execute next Invoked whenever event occurs that interrupts current process or provides an opportunity to preempt current one in favor of another Events: clock interrupt, I/O interrupt, OS call, signal 11

Long-term scheduling Determine which programs admitted to system for processing - controls degree of multiprogramming Once admitted, program becomes a process, either: added to queue for short-term scheduler swapped out (to disk), so added to queue for medium-term scheduler Batch Jobs Can system take a new process? more processes implies less time for each existing one add job(s) when a process terminates, or if percentage of processor idle time is greater than some threshold Which job to turn into a process first-come, first-serve (FCFS), or to manage overall system performance (e.g. based on priority, expected execution time, I/O requirements, etc.) 12

Process State Transitions New Long-term scheduling Ready, suspend Blocked, suspend Mediumterm scheduling Ready Blocked Shortterm scheduling Event wait Running Exit 13