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)

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. 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)

Uniprocessor Scheduling. Aim of Scheduling

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

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

Uniprocessor Scheduling. Chapter 9

Chapter 9 Uniprocessor Scheduling

Scheduling of processes

Uniprocessor Scheduling

Chapter 5: CPU Scheduling

Chapter 9. Uniprocessor Scheduling

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

Last Class: Processes

Lecture 2 Process Management

Course Syllabus. Operating Systems

CS370 Operating Systems

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

Operating Systems. Scheduling

Scheduling. The Basics

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Scheduling Bits & Pieces

CS3733: Operating Systems

Operating System Concepts Ch. 5: Scheduling

Scheduling in the Supermarket

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

CHAPTER 2: PROCESS MANAGEMENT

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

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

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

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

CS370 Operating Systems

Properties of Processes

8: Scheduling. Scheduling. Mark Handley

Chapter 5: CPU Scheduling

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

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

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

Announcements/Reminders

CS370 Operating Systems

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

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

Ch 4 : CPU scheduling

SMD149 - Operating Systems

Operating Systems ECE344. Ding Yuan

Operating System Review Part

CPU Scheduling Algorithms

CPU Scheduling: Objectives

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)

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

CSE 120 Principles of Operating Systems Spring 2017

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

Process Scheduling. Copyright : University of Illinois CS 241 Staff

High level scheduling: Medium level scheduling: Low level scheduling. Scheduling 0 : Levels

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

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

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

Practice Exercises 305

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

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Scheduling - Overview

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

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

1.1 CPU I/O Burst Cycle

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

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

COSC243 Part 2: 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)

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

Process- Concept &Process Scheduling OPERATING SYSTEMS

Chapter 6: CPU Scheduling

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

(MCQZ-CS604 Operating Systems)

A COMPARATIVE STUDY OF CPU SCHEDULING POLICIES IN OPERATING SYSTEMS

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

CS370 Operating Systems

Scheduling. Scheduling 1/51

LECTURE 3:CPU SCHEDULING

Chapter 5: CPU Scheduling

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

Tasks. Task Implementation and management

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

Comp 310 Computer Systems and Organization

Scheduling. Today. Next Time Process interaction & communication

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

CSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

Scheduling. Scheduling 1/51

CSE 120 Principles of Operating Systems

Processes, PCB, Context Switch

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

OPERATING SYSTEMS: Lesson 4: Process Scheduling

CS307: Operating Systems

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

Processes and Threads

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

Transcription:

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

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 2

Short-term scheduling algorithms First-Come, First-Served (FCFS, or FIFO) as process becomes ready, join Ready queue, scheduler always selects process that has been in queue longest better for long processes than short ones favors CPU-bound over I/O-bound processes need priorities, on uniprocessor, to make it effective 3

Algorithms (cont.) Round-Robin (RR) use preemption, based on clock - time slicing generate interrupt at periodic intervals when interrupt occurs, place running process in Ready queue, select next process to run using FCFS what s the length of a time slice short means short processes move through quickly, but high overhead to deal with clock interrupts and scheduling guideline is time slice should be slightly greater than time of typical job CPU burst problem dealing with CPU and I/O bound processes 4

Priorities Priority Based Scheduling assign each process a priority, and scheduler always chooses process of higher priority over one of lower priority More than one ready queue, ordered by priorities RQ0 RQ1 Dispatch CPU Release Admit. RQn Event Occurs Blocked queue Preemption Event Wait 5

Priority Algorithms Fixed Queues processes are statically assigned to a queue sample queues: system, foreground, background Multilevel Feedback processes are dynamically assigned to queues penalize jobs that have been running longer preemptive, with dynamic priority have N ready queues (RQ0-RQN), start process in RQ0 if quantum expires, moved to i + 1 queue 6

Feedback scheduling (cont.) problem: turnaround time for longer processes can increase greatly, even starve them, if new short jobs regularly enter system solution1: vary preemption times according to queue processes in lower priority queues have longer time slices solution2: promote a process to higher priority queue after it spends a certain amount of time waiting for service in its current queue, it moves up solution3: allocate fixed share of CPU time to jobs if a process doesn t use its share, give it to other processes variation on this idea: lottery scheduling assign a process tickets (# of tickets is share) pick random number and run the process with the winning ticket. 7

UNIX System V Multilevel feedback, with RR within each priority queue 10ms second preemption priority based on process type and execution history, lower value is higher priority priority recomputed once per second, and scheduler selects new process to run For process j, P(i) = Base + CPU(i-1)/2 + nice P(i) is priority of process j at interval i Base is base priority of process j CPU(i) = U(i)/2 + CPU(i-1)/2 U(i) is CPU use of process j in interval i exponentially weighted average CPU use of process j through interval i nice is user-controllable adjustment factor 8

UNIX (cont.) Base priority divides all processes into (nonoverlapping) fixed bands of decreasing priority levels swapper, block I/O device control, file manipulation, character I/O device control, user processes bands optimize access to block devices (disk), allow OS to respond quickly to system calls penalizes CPU-bound processes w.r.t. I/O bound targets general-purpose time sharing environment 9

Example: Windows NT/XP Target: single user, in highly interactive environment a server preemptive scheduler with multiple priority levels flexible system of priorities, RR within each, plus dynamic variation on basis of current thread activity for some levels 2 priority bands, real-time and variable, each with 16 levels real-time ones have higher priority, since require immediate attention(e.g. communication, real-time task) 10

Windows NT/XP (cont.) In real-time class, all threads have fixed priority that never changes In variable class, priority begins at an initial value, and can change, up or down FIFO queue at each level, but thread can switch queues Dynamic priority for a thread can be from 2 to 15 if thread interrupted because time slice is up, priority lowered if interrupted to wait on I/O event, priority raised favors I/O-bound over CPU-bound threads for I/O bound threads, priority raised more for interactive waits (e.g. keyboard, display) than for other I/O (e.g. disk) 11

Multi-Processor Scheduling Multiple processes need to be scheduled together Called gang-scheduling Allowing communicating processes to interact w/o/ waiting Try to schedule processes back to same processor Called affinity scheduling Maintain a small ready queue per processor Go to global queue if nothing local is ready 12

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 13

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.) 14

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

Cooperating Processes Often need to share information between processes information: a shared file computational speedup: break the problem into several tasks that can be run on different processors requires several processors to actually get speedup modularity: separate processes for different functions compiler driver, compiler, assembler, linker convenience: editing, printing, and compiling all at once 16

Interprocess Communication Communicating processes establish a link can more than two processes use a link? are links one way or two way? how to establish a link how do processes name other processes to talk to use the process id (signals work this way) use a name in the filesystem (UNIX domain sockets) indirectly via mailboxes (a separate object) Use send/receive functions to communicate send(dest, message) receive(dest, message) 17

Producer-consumer pair producer creates data and sends it to the consumer consumer read the data and uses it examples: compiler and assembler can be used as a producer consumer pair Buffering processes may not produce and consume items one by one need a place to store produced items for the consumer called a buffer could be fixed size (bounded buffer) or unlimited (unbounded buffer) 18

Message Passing What happens when a message is sent? sender blocks waiting for receiver to receive sender blocks until the message is on the wire sender blocks until the OS has a copy of the message sender blocks until the receiver responds to the message sort of like a procedure call could be expanded into a remote procedure call (RPC) system Error cases a process terminates: receiver could wait forever sender could wait or continue (depending on semantics) a message is lost in transit who detects this? could be OS or the applications Special case: if 2 messages are buffered, drop the older one useful for real-time info systems 19