LAST LECTURE ROUND-ROBIN 1 PRIORITIES. Performance of round-robin scheduling: Scheduling Algorithms: Slide 3. Slide 1. quantum=1:

Size: px
Start display at page:

Download "LAST LECTURE ROUND-ROBIN 1 PRIORITIES. Performance of round-robin scheduling: Scheduling Algorithms: Slide 3. Slide 1. quantum=1:"

Transcription

1 Slide LAST LETURE Scheduling Algorithms: FIFO Shortest job next Shortest remaining job next Highest Response Rate Next (HRRN) Slide 3 Performance of round-robin scheduling: Average waiting time: not optimal Performance depends heavily on size of time-quantum: - too short: overhead for context switch becomes too expensive - too large: degenerates to FFS policy - rule of thumb: about 8% of all bursts should be shorter than time quantum no starvation ROUND-ROBIN quantum=: A B PRIORITIES Each thread is associated with a priority Basic mechanism to influence scheduler decision: Slide 2 D E 2 quantum=4: A B Slide 4 Scheduler will always choose a thread of higher priority over one of lower priority Implemented via multiple FFS ready queues (one per priority) Lower-priority may suffer starvation adapt priority based on thread s age or execution history D E Priorities can be defined internally or externally 2 Scheduled thread is given a time slice Running thread is preempted upon clock interrupt, running thread is returned to ready queue - internal: e.g., memory requirements, I/O bound vs PU bound - external: e.g., importance of thread, importance of user ROUND-ROBIN PRIORITIES 2

2 Feedback scheduling: queueing: Admit RQ Processor Release Queue headers Runable processes RQ Release 4 (Highest priority) Processor Slide 3 Slide 7 2 RQn Release (Lowest priority) Processor Priorities influence access to resources, but do not guarantee a certain fraction of the resource (PU etc)! Feedback scheduling: 2 LOTTERY SHEDULING Slide 6 Feedback q = Feedback q = 2 i A B D E A B D E Penalize jobs that have been running longer Slide 8 process gets lottery tickets for various resources more lottery tickets imply better access to resource Advantages: Simple Highly responsive Allows cooperating processes/threads to implement individual scheduling policy (exchange of tickets) q = 2 i : longer time slice for lower priority (reduce starvation) PRIORITIES 3 LOTTERY SHEDULING 4

3 Example (taken from Embedded Systems Programming: Four processes a running concurrently Process A: % of PU time Process B: 2% of PU time Note: UNIX traditionally uses counter-intuitive priority representation (higher value = less priority) Slide 9 Process : % of PU time Process D: % of PU time How many tickets should each process get to achieve this? Number of tickets in proportion to PU time, e.g., if we have 2 tickets overall Process A: % of tickets: 3 Process B: 2% of tickets: Slide Bands: Decreasing order of priority Swapper Block I/O device control File manipulation haracter I/O device control User processes Process : % of tickets: Process D: % of tickets: TRADITIONAL UNIX SHEDULING (SVR3, 4.3 BSD) Objectives: support for time sharing good response time for interactive users support for low-priority background jobs Advantages: relatively simple, effective works well for single processor systems Slide Strategy: Multilevel feedback using round robin within priorities Priorities are recomputed once per second Base priority divides all processes into fixed bands of priority levels adjustment capped to keep processes within bands Slide 2 Disadvantages: significant overhead in large systems (recomputing priorities) response time not guaranteed non-preemptive kernel: lower priority process in kernel mode can delay high-priority process Favours I/O-bound over PU-bound processes TRADITIONAL UNIX SHEDULING (SVR3, 4.3 BSD) NON-PREEMPTIVE VS PREEMPTIVE KERNEL 6

4 Slide 3 NON-PREEMPTIVE VS PREEMPTIVE KERNEL kernel data structures have to be protected basically, two ways to solve the problem: Non-preemptive: disable all (most) interrupts while in kernel mode, so no other thread can get into kernel mode while in critial section - inversion possible - oarse grained - Works only for uniprocessor Preemptive: just lock kernel data structure which is currently modified - More fine-grained - Introduces additional overhead, can reduce throughput Slide PU Shared memory Local memory M M M M M M Interconnect (a) (b) (c) (b) Loosely coupled multiprocessor M M M M M M omplete system + M + M + M Internet + M + M + M Each processor has its own memory and I/O channels Generally called a distributed memory multiprocessor (c) Distributed System complete computer systems connected via wide area network communicate via message passing MULTIPROESSOR SHEDULING Slide 4 What kind of systems and applications are there? lassification of Multiprocessor Systems: PU Shared memory Local memory M M M M M M M Interconnect M M M M M omplete system + M + M + M Internet + M + M + M Slide 6 Independent parallelism: Separate applications/jobs No synchronization PARALLELISM Parallelism improves throughput, responsiveness Parallelism doesn t affect execution time of (single threaded) programs oarse and very coarse-grained parallelism: (a) (b) (c) Synchronization among processes is infrequent (a) Tightly coupled multiprocessing Good for loosely coupled multiprocessors Processors share main memory, controlled by single operating system, called symmetric multi-processor (SMP) system an be ported to multiprocessor with little change MULTIPROESSOR SHEDULING 7 PARALLELISM 8

5 Slide 7 Medium-grained parallelism: Parallel processing within a single application Application runs as multithreaded process Threads usually interact frequently Good for SMP systems Unsuitable for loosely-coupled systems Fine-grained parallelism: Highly parallel applications e.g., parallel execution of loop iterations Very frequent synchronisation Works only well on special hardware vector computers, symmetric multithreading (SMT) hardware Slide 9 ASSIGNMENT OF THREADS TO PROESSORS Treat processors as a pooled resource and assign threads to processors on demand Permanently assign threads to a processor - Dedicate short-term queue for each processor Low overhead Processor could be idle while another processor has a backlog Dynamically assign process to a processor higher overhead poor locality better load balancing MULTIPROESSOR SHEDULING Slide 8 Multiprocessor Scheduling: Which process should be run next and where? We discuss: Tightly coupled multiprocessing Very coarse to medium grained parallelism Homogeneous systems (all processors have same specs, access to devices) Design Issues: How to assign processes/threads to the available processors? Multiprogramming on individual processors? Which scheduling strategy? Slide 2 ASSIGNMENT OF THREADS TO PROESSORS Who decides which thread runs on which processor? Master/slave architecture: Key kernel functions always run on a particular processor Master is responsible for scheduling Slave sends service request to the master simple one processor has control of all resources, no synchronisation Failure of master brings down whole system Master can become a performance bottleneck Scheduling dependend processes ASSIGNMENT OF THREADS TO PROESSORS 9 ASSIGNMENT OF THREADS TO PROESSORS

6 LOAD SHARING: TIME SHARING PU PU 4 goes idle A PU 2 goes idle A 8 B Slide 2 Peer architecture: Operating system can execute on any processor Each processor does self-scheduling omplicates the operating system - Make sure no two processors schedule the same thread - Synchronise access to resources Proper symmetric multiprocessing Slide 22 7 A B 6 D E 6 D E 6 4 F 3 G H I 3 G H I 3 2 J K L M N B F J K L M N 7 (a) (b) (c) Load is distributed evenly across the processors Use global ready queue 4 2 D F E G H I J K L M N Threads are not assigned to a particular processor Scheduler picks any ready thread (according to scheduling policy) Actual scheduling policy less important than on uniprocessor No centralized scheduler required Disadvantages of time sharing: entral queue needs mutual exclusion Slide 23 Potential race condition when several PUs are trying to pick a thread from ready queue May be a bottleneck blocking processors Preempted threads are unlikely to resume execution on the same processor ache use is less efficient, bad locality Different threads of same process unlikely to execute in parallel Potentially high intra-process communication latency ASSIGNMENT OF THREADS TO PROESSORS LOAD SHARING: TIME SHARING 2

7 GANG SHEDULING Slide 24 Thread A running PU A B A B A B Request Request 2 Reply Reply 2 PU B A B A B A Time Slide 26 ombined time and space sharing: Simultaneous scheduling of threads that make up a single process Useful for applications where performance severely degrades when any part of the application is not running e.g., often need to synchronise with each other Time slot PU A B D E A B D A B D E 2 A B D A 2 B 2 D 2 E 3 A 2 B 2 D 2 A 3 D 3 E 4 A 3 D 3 A 4 D 4 E A 4 D 4 A 2 E E 6 A 2 E 7 E E 2 E 3 E 4 E E 6 SMP SUPPORT IN MODERN GENERAL PURPOSE OS S a Slide 2 LOAD SHARING: SPAE SHARING Scheduling multiple threads of same process across multiple PUs 8-PU partition 6-PU partition Unassigned PU 2-PU partition 4-PU partition statically assigned to PUs at creation time (figure) or dynamic assignment using a central server Slide 27 Solaris 8.: up to 28 Linux 2.4: up to 32 Windows 2 Data enter: up to 32 OS/2 Warp: up to 64 SMP Scheduling in Linux 2.4: tries to schedule process on same PU if the PU busy, assigns it to an idle PU otherwise, checks if process priority allows interrupt on preferred PU uses spin locks to protect kernel data structures a (source GANG SHEDULING 3 WINDOWS 2 SHEDULING 4

8 Slide 28 WINDOWS 2 SHEDULING priority driven, preemptive scheduling system if thread with higher priority becomes ready to run, current thread is preempted scheduled at thread granularity priorities: (zero-page thread), - (variable levels), 6-3 (realtime levels soft) Slide 3 What is a real-time system? REAL-TIME SYSTEMS A real-time system is a system whose correctness includes its response time as well as its functional correctness. What is a hard real-time system? each thread has a quantum value, clock-interrupt handler deducts 3 from running thread quantum default value of quantum: 6 Windows 2 Professional, 36 on Windows 2 Server most wait-operations result in temporary priority boost, favouring IO-bound threads A real-time system with guaranteed worst case response times. Hard real-time systems fail if deadlines cannot be met Service of soft real-time systems degrades if deadlines cannot be met REALTIME SYSTEMS Real-time systems: Slide 29 Overview: Real time systems - Hard and soft real time systems - Real time scheduling - A closer look at some real time operating systems Slide 3 no clear separation system may meet hard deadline of one application, but not of other depending on application, time-scale may vary from microseconds to seconds most systems have some real-time requirements REAL-TIME SYSTEMS REAL-TIME SYSTEMS 6

9 HARATERISTIS OF REAL-TIME OPERATING SYSTEMS Soft Real-time Applications: Many multi-media apps e.g., DVD or MP3 player Many real-time games, networked games Deterministic: interrupt? How long does it take to acknowledge Operations are performed at fixed, predetermined times or within predetermined time intervals Slide 32 Hard Real-time Applications: ontrol of laboratory experiments Embedded devices Process control plants Robotics Air traffic control Slide 34 Depends on - response time of system for interrupts - capacity of system annot be fully deterministic when processes are competing for resources Requires preemptive kernel Telecommunications Responsive: How long does it take to service the interrupt? Military command and control systems Includes amount of time to begin execution of the interrupt Includes the amount of time to perform the interrupt HARATERISTIS OF REAL-TIME OPERATING SYSTEMS Slide 33 Hard real-time systems: often lack full functionality of modern OS secondary memory usually limited or missing data stored in short term or read-only memory no time sharing Slide 3 User control: User has much more control compared to ordinary OS s User specifies priority Specify paging Which processes must always reside in main memory Disks algorithms to use Modern operating systems provide support for soft real-time applications Hard real-time OS either specially tailored OS, modular systems, or customized version of general purpose OS. Rights of processes Reliability: Failure, loss, degradation of performance may have catastrophic consequences Attempt either to correct the problem or minimize its effects while continuing to run Most critical, high priority tasks execute HARATERISTIS OF REAL-TIME OPERATING SYSTEMS 7 HARATERISTIS OF REAL-TIME OPERATING SYSTEMS 8

10 HARATERISTIS OF REAL-TIME OPERATING SYSTEMS REAL-TIME SHEDULING Slide 36 General purpose OS objectives like speed fairness maximising throughput minimising average response time are not priorities in real time OS s! Slide 38 Preemptive round-robin: lock tick Request from a real-time process Process Real-time process added to run queue to await its next slice Process 2 Scheduling time Process n Real-time process Slide 37 Features of real-time operating systems: Fast context switch Small size Ability to respond to external interrupts quickly Predictability of system performance! Use of special sequential files that can accumulate data at a fast rate Preemptive scheduling based on priority Minimization of intervals during which interrupts are disabled Delay tasks for fixed amount of time Slide 39 Non-preemptive priority: Request from a real-time process REAL-TIME SHEDULING urrent process Scheduling time Real-time process added to head of run queue Real-time process urrent process blocked or completed REAL-TIME SHEDULING 9 REAL-TIME SHEDULING 2

11 REAL-TIME SHEDULING lasses of Algorithms: Slide 4 Preemption points: Preemption point REAL-TIME SHEDULING Request from a real-time process urrent process Scheduling time Wait for next preemption point Real-time process Slide 42 Static table-driven - suitable for periodic tasks - input: periodic arrival, ending and execution time - output: schedule that allows all processes to meet requirements (if at all possible) - determines at which points in time a task begins execution Static priority-driven preemptive - static analysis determines priorities - traditional priority-driven scheduler is used Dynamic planning-based - feasibility to integrate new task is determined dynamically Dynamic best effort - no feasibility analysis - typically aperiodic, no static analysis possible - does its best, procs that missed deadline aborted When are periodic events schedulable? P i: period with which event i occurs Slide 4 Immediate preemptive: REAL-TIME SHEDULING Request from a real-time process urrent process Real-time process preempts current process and executes immediately Real-time process Slide 43 i: PU time required to handle event i A set of events e to e m is schedulable if Example: m i= i P i three periodic events with periods of, 2, and msecs Scheduling time require, 3, and msec of PU time schedulable? = REAL-TIME SHEDULING 2 DEADLINE SHEDULING 22

12 DEADLINE SHEDULING DEADLINE SHEDULING Earliest deadline first strategy is provably optimal. It Slide 44 urrent systems often try to provide real-time support by starting real time tasks are quickly as possible speeding up interrupt handling and task dispatching Not necessarily appropriate, since real-time applications are not concerned with speed but with reliably completing tasks priorities alone are not sufficient Slide 46 minimises number of tasks that miss deadline if there is a schedule for a set of tasks, earliest deadline first will find it Earliest deadline first can be used for dynamic or static scheduling works with starting or completion deadline for any given preemption strategy - starting deadlines are given: nonpreemptive - completion deadline: preemptive Two tasks: DEADLINE SHEDULING Sensor A: Sensor B: Slide 4 Additional information used: Ready time - sequence of times for periodic tasks, may or may not be known statically Starting deadline ompletion deadline Processing time - may or may not be known, approximated Resource requirements Subtask scheduler Slide 47 data arrives every 2ms processing takes ms Scheduling decision every ms data arrives every ms processing takes 2ms Task Arrival Time Execution Time Deadline A() 2 A(2) 2 4 A(3) B() 2 B(2) DEADLINE SHEDULING 23 DEADLINE SHEDULING 24

13 Periodic threads with completion deadline: RATE MONOTONI SHEDULING Slide 48 Arrival times, execution times, and deadlines Fixed-priority scheduling; A has priority A deadline A2 deadline B deadline A3 deadline A4 deadline A A2 A3 A4 A B B2 B deadline A deadline Time(ms) A B A2 B A3 B2 A4 B2 A B2 A A2 B A3 A4 A, B2 (missed) Slide Works for processes which are periodic need the same amount of PU time on each burst optimal static scheduling algorithm guaranteed to succeed if m i= i P i m (2 m ) Fixed-priority scheduling; B has priority Earliest deadline scheduling using completion deadlines B A (missed) A2 A3 B2 A B A2 A3 A4 (missed) A B A2 B A3 B2 A4 B2 A A, B2 A A2 B A3 A4 A, B2 for m =,,,:,.7,.69,.693 Works by assigning priorities to threads on the basis of their periods highest-priority task is the one with the shortest period Aperiodic threads with starting deadline: Arrival times A B D E Requirements Starting deadline Arrival times B E D A A B D E Periodic task timing diagram: ycle ycle 2 Slide 49 Earliest deadline Earliest deadline with unforced idle times Service Starting deadline Arrival times Service Starting deadline Arrival times A E D B (missed) E D A A B D E B E D A B E D A A B D E Slide P Processing Idle task P execution time task P period T Processing Time First-come first-served (FFS) Service Starting deadline A D B (missed) E (missed) D A RATE MONOTONI SHEDULING 2 RATE MONOTONI SHEDULING 26

14 Task set with RMS: High Highest rate and highest priority task WHY USE RMS? Slide 2 Slide 4 Despite some obvious disadvantages of RMS over EDF, RMS is sometimes used it has a lower overhead simple in pratice, performance similar Lowest rate and lowest priority task greater stability, predictability Low Rate (Hz) LINUX 2.4 SHEDULING SOFT REAL-TIME SUPPORT - A: /3, B: /4, : / User assigns static priority to real time processes (-99), never changed by scheduler A B A B A2 A3 A4 B2 B3 A B4 onventional processes have dynamic priority, always lower than real time processes - sum of base priority and Slide Slide - number of clock ticks left of quantum for current epoch Scheduling classes RMS A B A2 B2 Failed SHED FIFO: First-in-first-out real-time threads EDF A B A2 B2 A3 2 B3 A4 3 A B4 SHED RR: Round-robin real-time threads SHED OTHER: Other, non-real-time threads Within each class multiple priorities may be used Deadlines cannot be specified, no guarantees given Time (msec) Due to non-preemptive kernel, latency can be too high for real-time systems WHY USE RMS? 27 LINUX 2.4 SHEDULING SOFT REAL-TIME SUPPORT 28

15 Linux scheduling: SVR4 dispatch queues: A minimum Highest priority B middle middle D B A -4-3 Waiting for disk I/O Waiting for disk buffer Process waiting in kernel mode Slide 6 D maximum (a) Relative thread priorities (b) Flow with FIFO scheduling Slide Waiting for terminal input Waiting for terminal output Waiting for child to exist User priority D B B A 2 3 User priority User priority 2 User priority 3 Process waiting in user mode (c) Flow with RR scheduling Lowest priority Process queued on priority level 3 Slide 7 UNIX SVR4 SHEDULING Highest preference to real-time processes Next-highest to kernel-mode processes Lowest preference to other user-mode processes Real time processes may block system services Slide 9 WINDOWS 2 SHEDULING Priorities organized into two bands or classes Real-time Variable -driven preemptive scheduler also, no deadlines, no guarantees UNIX SVR4 SHEDULING 29 WINDOWS 2 SHEDULING 3

16 System priorities 3 24 Next thread to run Problem: in real life applications, many tasks are not always periodic. static priorities may not work If real time threads run periodically with same length, fixed priority is no problem: Slide 6 6 Slide 62 User priorities 8 a a a a a a a b b b b b b b Zero page thread Idle thread - a: periodic real time thread, highest priority - b: periodic real time thread - various different low priority tasks (e.g., user I/O) Slide base priority highest above normal normal below normal lowest Slide 63 But if frequency of high priority task increases temporarily, system may encounter overload: - system not able to respond - system may not be able to perform requested service Process Thread s Base Thread s Dynamic WINDOWS 2 SHEDULING 3 WINDOWS 2 SHEDULING 32

17 Example: Network interface control driver, requirements: avoid if possible to drop packets definitely avoid overload Basic Idea: simulation of periodic behaviour of thread by assigning realtime priority: P r Slide 64 If receiver thread get highest priority permanently, system may go into overload if incoming rate exceeds a certain value. expected frequency: packet once every 64µs PU time required to process packet: 2µs 32-entry ring buffer, max % full packet every 64µs receiver thread 2µs/packet Slide 66 background priority: P b execution budget: E replenishment interval: R to thread. Whenever thread exhausts execution budget, priority is set to background priority P b When thread blocks after n units, n will be added to execution budget R units after execution started When execution budget is incremented, thread priority is reset to P r Example: Slide 6 POSIX standard to handle aperiodic or sporadic events SPORADI SHEDULING with static priority, preemptive scheduler Implemented in hard real-time systems such as QNX, some real-time versions of Linux, real-time specification for Java (RTSJ)(partially) an be used to avoid overloading in a system Slide 67 execution budget: replenishment interval: 3 Thread does not block: budget replenishment interval time SPORADI SHEDULING 33 SPORADI SHEDULING 34

18 Thread blocks: budget replenishment interval HARD REAL TIME OS Slide 68 replenishment interval 2 time () exection starts, st replenishment interval starts (3) thread blocks () continues execution, 2nd replenishment interval starts (7) budget exhausted (3) budget set to 3, thread continues execution (6) budget exhausted (8) budget set to 2 (9) thread continues execution Slide 7 We look at examples of two types of systems: configurable hard real time systems system designed as real time OS from the start hard real-time variants of general purpose OSs try to alleviate shortcomings of OS with respect to real time apps Example: Network interface control Driver Slide 69 use expected incoming rate and desired max PU utilisation of thread to compute execution budget and replenishment period if no other threads wait for execution, packets can be processed even if load is higher otherwise, packets may be dropped packet every 64µs receiver thread 2µs/packet Slide 7 REAL-TIME SUPPORT IN LINUX Scheduling: - POSIX SHED FIFO, SHED RR, - ongoing efforts to improve scheduler efficiency Virtual Memory: - no VM for real-time apps - mlock() and mlockall() to switch off paging period: 64µs * 6 = 24µs execution time: 2µs * 6 = 4µs PU load caused by receiver thread: 4/24 =.39, about 39% Timer: resolution: ms, too coarse grained for real-time apps HARD REAL TIME OS 3 HIGH KERNEL LATENY IN LINUX 36

19 QNX HIGH KERNEL LATENY IN LINUX Possible solutions: Low Latency Linux Microkernel based architecture POSIX standard API Modular can be costumised for very small size (eg, embedded systems) or large systems Slide 72 - thread in kernel mode yields PU - reduces size of non-preemptable sections - used in some real-time variants of Linux Preemptable Linux - kernel data protected using mutexes/spinlocks Lock breaking preemptable Linux - combination of previous two approaches Slide 74 Memory protection for user applications and os components Scheduling: FIFO scheduling Round-robin Adaptive scheduling - thread consumes its timeslice, its priority is reduced by one - thread blocks, it immediately comes back to its base priority POSIX sporadic scheduling RTLINUX WINDOWS E 3. Slide 73 abstract machine layer between actual hardware and Linux kernel takes control of - hardware interrupts - timer hardware - interrupt disable mechanism Slide 7 omponentised OS designed for embedded systems with hard real-time support handles nested interrupts handles priority inversion based on priority inheritance Offers real time scheduler runs with no interference fron Linux kernel guaranteed upper bound on high priority thread scheduling programmer must utilise RTLinux API for real time applications guaranteed upper bound on delay for interrupt service routines QNX 37 WINDOWS E 3. 38

20 Linux scheduling: A minimum Slide 76 B middle middle D maximum (a) Relative thread priorities D B A (b) Flow with FIFO scheduling Slide 78 WINDOWS 2 SHEDULING Priorities organized into two bands or classes Real-time Variable -driven preemptive scheduler D B B A (c) Flow with RR scheduling Highest (3) Slide 77 UNIX SVR4 SHEDULING Highest preference to real-time processes Next-highest to kernel-mode processes Lowest preference to other user-mode processes SVR4 dispatch queues: Slide 79 Real-time lasses Lowest (6) Highest () dqactmap dispq 9 n 2 P P P P P P P Variable lasses Lowest () WINDOWS 2 SHEDULING 39 WINDOWS 2 SHEDULING 4

21 Slide base priority highest above normal normal below normal lowest Process Thread s Base Thread s Dynamic WINDOWS 2 SHEDULING 4

Multiprocessor and Real-Time Scheduling. Chapter 10

Multiprocessor and Real-Time Scheduling. Chapter 10 Multiprocessor and Real-Time Scheduling Chapter 10 1 Roadmap Multiprocessor Scheduling Real-Time Scheduling Linux Scheduling Unix SVR4 Scheduling Windows Scheduling Classifications of Multiprocessor Systems

More information

OVERVIEW. Last Week: But if frequency of high priority task increases temporarily, system may encounter overload: Today: Slide 1. Slide 3.

OVERVIEW. Last Week: But if frequency of high priority task increases temporarily, system may encounter overload: Today: Slide 1. Slide 3. OVERVIEW Last Week: Scheduling Algorithms Real-time systems Today: But if frequency of high priority task increases temporarily, system may encounter overload: Yet another real-time scheduling algorithm

More information

Multiprocessor and Real- Time Scheduling. Chapter 10

Multiprocessor and Real- Time Scheduling. Chapter 10 Multiprocessor and Real- Time Scheduling Chapter 10 Classifications of Multiprocessor Loosely coupled multiprocessor each processor has its own memory and I/O channels Functionally specialized processors

More information

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

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling Uniprocessor Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Three level scheduling 2 1 Types of Scheduling 3 Long- and Medium-Term Schedulers Long-term scheduler Determines which programs

More information

ECE519 Advanced Operating Systems

ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (10 th Week) (Advanced) Operating Systems 10. Multiprocessor, Multicore and Real-Time Scheduling 10. Outline Multiprocessor

More information

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

Today s class. Scheduling. Informationsteknologi. Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1 Today s class Scheduling Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1 Aim of Scheduling Assign processes to be executed by the processor(s) Need to meet system objectives regarding:

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

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

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date: Subject Name: OPERATING SYSTEMS Subject Code: 10EC65 Prepared By: Kala H S and Remya R Department: ECE Date: Unit 7 SCHEDULING TOPICS TO BE COVERED Preliminaries Non-preemptive scheduling policies Preemptive

More information

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

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou (  Zhejiang University Operating Systems (Fall/Winter 2018) CPU Scheduling Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review Motivation to use threads

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 10 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Chapter 6: CPU Scheduling Basic Concepts

More information

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. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM. Program #1 Announcements Is due at 9:00 AM on Thursday Program #0 Re-grade requests are due by Monday at 11:59:59 PM Reading Chapter 6 1 CPU Scheduling Manage CPU to achieve several objectives: maximize

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

CPU Scheduling: Objectives

CPU Scheduling: Objectives CPU Scheduling: Objectives CPU scheduling, the basis for multiprogrammed operating systems CPU-scheduling algorithms Evaluation criteria for selecting a CPU-scheduling algorithm for a particular system

More information

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling Uniprocessor Scheduling Chapter 9 Aim of Scheduling Response time Throughput Processor efficiency Types of Scheduling Long-Term Scheduling Determines which programs are admitted to the system for processing

More information

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

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency Uniprocessor Scheduling Chapter 9 Aim of Scheduling Response time Throughput Processor efficiency Types of Scheduling Long-Term Scheduling Determines which programs are admitted to the system for processing

More information

Multiprocessor scheduling

Multiprocessor scheduling Chapter 10 Multiprocessor scheduling When a computer system contains multiple processors, a few new issues arise. Multiprocessor systems can be categorized into the following: Loosely coupled or distributed.

More information

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

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter Lecture Topics Today: Advanced Scheduling (Stallings, chapter 10.1-10.4) Next: Deadlock (Stallings, chapter 6.1-6.6) 1 Announcements Exam #2 returned today Self-Study Exercise #10 Project #8 (due 11/16)

More information

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

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter Lecture Topics Today: Uniprocessor Scheduling (Stallings, chapter 9.1-9.3) Next: Advanced Scheduling (Stallings, chapter 10.1-10.4) 1 Announcements Self-Study Exercise #10 Project #8 (due 11/16) Project

More information

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

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013) CPU Scheduling Daniel Mosse (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013) Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

More information

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5 OPERATING SYSTEMS CS3502 Spring 2018 Processor Scheduling Chapter 5 Goals of Processor Scheduling Scheduling is the sharing of the CPU among the processes in the ready queue The critical activities are:

More information

Last Class: Processes

Last Class: Processes Last Class: Processes A process is the unit of execution. Processes are represented as Process Control Blocks in the OS PCBs contain process state, scheduling and memory management information, etc A process

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2019 Lecture 8 Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ POSIX: Portable Operating

More information

8: Scheduling. Scheduling. Mark Handley

8: Scheduling. Scheduling. Mark Handley 8: Scheduling Mark Handley Scheduling On a multiprocessing system, more than one process may be available to run. The task of deciding which process to run next is called scheduling, and is performed by

More information

Learning Outcomes. Scheduling. Is scheduling important? What is Scheduling? Application Behaviour. Is scheduling important?

Learning Outcomes. Scheduling. Is scheduling important? What is Scheduling? Application Behaviour. Is scheduling important? Learning Outcomes Scheduling Understand the role of the scheduler, and how its behaviour influences the performance of the system. Know the difference between I/O-bound and CPU-bound tasks, and how they

More information

Uniprocessor Scheduling. Chapter 9

Uniprocessor Scheduling. Chapter 9 Uniprocessor Scheduling Chapter 9 1 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency 2 3 4 Long-Term Scheduling Determines which programs

More information

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

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections ) CPU Scheduling CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections 6.7.2 6.8) 1 Contents Why Scheduling? Basic Concepts of Scheduling Scheduling Criteria A Basic Scheduling

More information

LECTURE 3:CPU SCHEDULING

LECTURE 3:CPU SCHEDULING LECTURE 3:CPU SCHEDULING 1 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time CPU Scheduling Operating Systems Examples Algorithm Evaluation 2 Objectives

More information

Operating Systems. Scheduling

Operating Systems. Scheduling Operating Systems Scheduling Process States Blocking operation Running Exit Terminated (initiate I/O, down on semaphore, etc.) Waiting Preempted Picked by scheduler Event arrived (I/O complete, semaphore

More information

Uniprocessor Scheduling

Uniprocessor Scheduling Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall CPU- and I/O-bound processes

More information

CHAPTER 2: PROCESS MANAGEMENT

CHAPTER 2: PROCESS MANAGEMENT 1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:

More information

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)

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

More information

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):

More information

Chapter 9. Uniprocessor Scheduling

Chapter 9. Uniprocessor Scheduling Operating System Chapter 9. Uniprocessor Scheduling Lynn Choi School of Electrical Engineering Scheduling Processor Scheduling Assign system resource (CPU time, IO device, etc.) to processes/threads to

More information

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)

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) 1/32 CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 2/32 CPU Scheduling Scheduling decisions may take

More information

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

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke CSCI-GA.2250-001 Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke frankeh@cs.nyu.edu Processes Vs Threads The unit of dispatching is referred to as a thread or lightweight

More information

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

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009 CS211: Programming and Operating Systems Lecture 17: Threads and Scheduling Thursday, 05 Nov 2009 CS211 Lecture 17: Threads and Scheduling 1/22 Today 1 Introduction to threads Advantages of threads 2 User

More information

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

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni Operating Systems Lecture 2.2 - Process Scheduling Golestan University Hossein Momeni momeni@iust.ac.ir Scheduling What is scheduling? Goals Mechanisms Scheduling on batch systems Scheduling on interactive

More information

Chapter 5: CPU Scheduling

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

More information

Chapter 5 CPU scheduling

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

More information

SMD149 - Operating Systems

SMD149 - Operating Systems SMD149 - Operating Systems Roland Parviainen November 3, 2005 1 / 45 Outline Overview 2 / 45 Process (tasks) are necessary for concurrency Instance of a program in execution Next invocation of the program

More information

Chapter 9 Uniprocessor Scheduling

Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 9 Uniprocessor Scheduling Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Aim of Scheduling Assign

More information

Operating Systems Unit 3

Operating Systems Unit 3 Unit 3 CPU Scheduling Algorithms Structure 3.1 Introduction Objectives 3.2 Basic Concepts of Scheduling. CPU-I/O Burst Cycle. CPU Scheduler. Preemptive/non preemptive scheduling. Dispatcher Scheduling

More information

Scheduling. Scheduling 1/51

Scheduling. Scheduling 1/51 Scheduling 1/51 Learning Objectives Scheduling To understand the role of a scheduler in an operating system To understand the scheduling mechanism To understand scheduling strategies such as non-preemptive

More information

Scheduling in the Supermarket

Scheduling in the Supermarket Scheduling in the Supermarket Consider a line of people waiting in front of the checkout in the grocery store. In what order should the cashier process their purchases? Scheduling Criteria CPU utilization

More information

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system Real world exposed programs Programs written to interact with the real world, outside the computer Programs handle input and output of data in pace matching the real world processes Necessitates ability

More information

Computer Systems Assignment 4: Scheduling and I/O

Computer Systems Assignment 4: Scheduling and I/O Autumn Term 018 Distributed Computing Computer Systems Assignment : Scheduling and I/O Assigned on: October 19, 018 1 Scheduling The following table describes tasks to be scheduled. The table contains

More information

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13 PROCESS SCHEDULING II CS124 Operating Systems Fall 2017-2018, Lecture 13 2 Real-Time Systems Increasingly common to have systems with real-time scheduling requirements Real-time systems are driven by specific

More information

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

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005 INF060: Introduction to Operating Systems and Data Communication Operating Systems: Processes & CPU Pål Halvorsen /9-005 Overview Processes primitives for creation and termination states context switches

More information

Scheduling. CSC400 - Operating Systems. 7: Scheduling. J. Sumey. one of the main tasks of an OS. the scheduler / dispatcher

Scheduling. CSC400 - Operating Systems. 7: Scheduling. J. Sumey. one of the main tasks of an OS. the scheduler / dispatcher CSC400 - Operating Systems 7: Scheduling J. Sumey Scheduling one of the main tasks of an OS the scheduler / dispatcher concerned with deciding which runnable process/thread should get the CPU next occurs

More information

Scheduling of processes

Scheduling of processes Scheduling of processes Processor scheduling Schedule processes on the processor to meet system objectives System objectives: Assigned processes to be executed by the processor Response time Throughput

More information

Chapter 5: CPU Scheduling

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

More information

Course Syllabus. Operating Systems

Course Syllabus. Operating Systems Course Syllabus. Introduction - History; Views; Concepts; Structure 2. Process Management - Processes; State + Resources; Threads; Unix implementation of Processes 3. Scheduling Paradigms; Unix; Modeling

More information

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)

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) CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 1 / 31 CPU Scheduling new admitted interrupt exit terminated

More information

Scheduling. Scheduling 1/51

Scheduling. Scheduling 1/51 Scheduling 1/51 Scheduler Scheduling Scheduler allocates cpu(s) to threads and processes. This action is known as scheduling. The scheduler is a part of the process manager code that handles scheduling.

More information

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

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

More information

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

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University Frequently asked questions from the previous class survey CS 370: SYSTEM ARCHITECTURE & SOFTWARE [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University OpenMP compiler directives

More information

Two Real-Time Operating Systems and Their Scheduling Algorithms: QNX vs. RTLinux

Two Real-Time Operating Systems and Their Scheduling Algorithms: QNX vs. RTLinux Two Real-Time Operating Systems and Their Scheduling Algorithms: QNX vs. RTLinux Daniel Svärd dansv077@student.liu.se Freddie Åström freas157@student.liu.se November 19, 2006 Abstract This report tries

More information

Operating System Review Part

Operating System Review Part Operating System Review Part CMSC 602 Operating Systems Ju Wang, 2003 Fall Virginia Commonwealth University Review Outline Definition Memory Management Objective Paging Scheme Virtual Memory System and

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 Operating System Concepts 8 th Edition, Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

More information

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

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College CISC 7310X C05: CPU Scheduling Hui Chen Department of Computer & Information Science CUNY Brooklyn College 3/1/2018 CUNY Brooklyn College 1 Outline Recap & issues CPU Scheduling Concepts Goals and criteria

More information

Process- Concept &Process Scheduling OPERATING SYSTEMS

Process- Concept &Process Scheduling OPERATING SYSTEMS OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne PROCESS MANAGEMENT Current day computer systems allow multiple

More information

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9 Implementing Scheduling Algorithms Real-Time and Embedded Systems (M) Lecture 9 Lecture Outline Implementing real time systems Key concepts and constraints System architectures: Cyclic executive Microkernel

More information

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

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts CS307 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU Scheduling CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

More information

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW 2 SO FAR talked about in-kernel building blocks: threads memory IPC drivers

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 Thread Scheduling Operating Systems Examples Java Thread Scheduling

More information

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst Operating Systems CMPSCI 377 Spring 2017 Mark Corner University of Massachusetts Amherst Multilevel Feedback Queues (MLFQ) Multilevel feedback queues use past behavior to predict the future and assign

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information

Ch 4 : CPU scheduling

Ch 4 : CPU scheduling Ch 4 : CPU scheduling It's the basis of multiprogramming operating systems. By switching the CPU among processes, the operating system can make the computer more productive In a single-processor system,

More information

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems Processes CS 475, Spring 2018 Concurrent & Distributed Systems Review: Abstractions 2 Review: Concurrency & Parallelism 4 different things: T1 T2 T3 T4 Concurrency: (1 processor) Time T1 T2 T3 T4 T1 T1

More information

Operating Systems ECE344. Ding Yuan

Operating Systems ECE344. Ding Yuan Operating Systems ECE344 Ding Yuan Announcement & Reminder Midterm exam Will grade them this Friday Will post the solution online before next lecture Will briefly go over the common mistakes next Monday

More information

Scheduling. Today. Next Time Process interaction & communication

Scheduling. Today. Next Time Process interaction & communication Scheduling Today Introduction to scheduling Classical algorithms Thread scheduling Evaluating scheduling OS example Next Time Process interaction & communication Scheduling Problem Several ready processes

More information

Comparison of scheduling in RTLinux and QNX. Andreas Lindqvist, Tommy Persson,

Comparison of scheduling in RTLinux and QNX. Andreas Lindqvist, Tommy Persson, Comparison of scheduling in RTLinux and QNX Andreas Lindqvist, andli299@student.liu.se Tommy Persson, tompe015@student.liu.se 19 November 2006 Abstract The purpose of this report was to learn more about

More information

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)

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) CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 1 / 39 CPU Scheduling new admitted interrupt exit terminated

More information

Practice Exercises 305

Practice Exercises 305 Practice Exercises 305 The FCFS algorithm is nonpreemptive; the RR algorithm is preemptive. The SJF and priority algorithms may be either preemptive or nonpreemptive. Multilevel queue algorithms allow

More information

CS 326: Operating Systems. CPU Scheduling. Lecture 6

CS 326: Operating Systems. CPU Scheduling. Lecture 6 CS 326: Operating Systems CPU Scheduling Lecture 6 Today s Schedule Agenda? Context Switches and Interrupts Basic Scheduling Algorithms Scheduling with I/O Symmetric multiprocessing 2/7/18 CS 326: Operating

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling COP 4610: Introduction to Operating Systems (Fall 2016) Chapter 5: CPU Scheduling Zhi Wang Florida State University Contents Basic concepts Scheduling criteria Scheduling algorithms Thread scheduling Multiple-processor

More information

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

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms Operating System Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts Scheduling Criteria Scheduling Algorithms OS Process Review Multicore Programming Multithreading Models Thread Libraries Implicit

More information

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an

More information

Frequently asked questions from the previous class survey

Frequently asked questions from the previous class survey CS 370: OPERATING SYSTEMS [CPU SCHEDULING] Shrideep Pallickara Computer Science Colorado State University L14.1 Frequently asked questions from the previous class survey Turnstiles: Queue for threads blocked

More information

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

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 Interactive Scheduling Algorithms Continued o Priority Scheduling Introduction Round-robin assumes all processes are equal often not the case Assign a priority to each process, and always choose the process

More information

Operating Systems CS 323 Ms. Ines Abbes

Operating Systems CS 323 Ms. Ines Abbes Taibah University College of Community of Badr Computer Science Department Operating Systems CS71/CS72 جامعة طيبة كلية المجتمع ببدر قسم علوم الحاسب مقرر: نظم التشغيل Operating Systems CS 323 Ms. Ines Abbes

More information

CS3733: Operating Systems

CS3733: Operating Systems CS3733: Operating Systems Topics: Process (CPU) Scheduling (SGG 5.1-5.3, 6.7 and web notes) Instructor: Dr. Dakai Zhu 1 Updates and Q&A Homework-02: late submission allowed until Friday!! Submit on Blackboard

More information

Multiprocessor Systems. COMP s1

Multiprocessor Systems. COMP s1 Multiprocessor Systems 1 Multiprocessor System We will look at shared-memory multiprocessors More than one processor sharing the same memory A single CPU can only go so fast Use more than one CPU to improve

More information

Unit 3 : Process Management

Unit 3 : Process Management Unit : Process Management Processes are the most widely used units of computation in programming and systems, although object and threads are becoming more prominent in contemporary systems. Process management

More information

Operating Systems. Process scheduling. Thomas Ropars.

Operating Systems. Process scheduling. Thomas Ropars. 1 Operating Systems Process scheduling Thomas Ropars thomas.ropars@univ-grenoble-alpes.fr 2018 References The content of these lectures is inspired by: The lecture notes of Renaud Lachaize. The lecture

More information

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

High level scheduling: Medium level scheduling: Low level scheduling. Scheduling 0 : Levels Scheduling 0 : Levels High level scheduling: Deciding whether another process can run is process table full? user process limit reached? load to swap space or memory? Medium level scheduling: Balancing

More information

Comp 310 Computer Systems and Organization

Comp 310 Computer Systems and Organization Comp 310 Computer Systems and Organization Lecture #9 Process Management (CPU Scheduling) 1 Prof. Joseph Vybihal Announcements Oct 16 Midterm exam (in class) In class review Oct 14 (½ class review) Ass#2

More information

Scheduling II. Today. Next Time. ! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling. !

Scheduling II. Today. Next Time. ! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling. ! Scheduling II Today! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling Next Time! Memory management Scheduling with multiple goals! What if you want both good turnaround

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 8 Threads and Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How many threads

More information

Interactive Scheduling

Interactive Scheduling Interactive Scheduling 1 Two Level Scheduling Interactive systems commonly employ two-level scheduling CPU scheduler and Memory Scheduler Memory scheduler was covered in VM We will focus on CPU scheduling

More information

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

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule Two Level Scheduling Interactive Scheduling Interactive systems commonly employ two-level scheduling CPU scheduler and Memory Scheduler Memory scheduler was covered in VM We will focus on CPU scheduling

More information

INF1060: Introduction to Operating Systems and Data Communication. Pål Halvorsen. Wednesday, September 29, 2010

INF1060: Introduction to Operating Systems and Data Communication. Pål Halvorsen. Wednesday, September 29, 2010 INF1060: Introduction to Operating Systems and Data Communication Pål Halvorsen Wednesday, September 29, 2010 Overview Processes primitives for creation and termination states context switches processes

More information

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

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Midterm Exam Reviews ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Particular attentions on the following: System call, system kernel Thread/process, thread vs process

More information

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

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008. CSC 4103 - Operating Systems Spring 2008 Lecture - XII Midterm Review Tevfik Ko!ar Louisiana State University March 4 th, 2008 1 I/O Structure After I/O starts, control returns to user program only upon

More information

Scheduling. The Basics

Scheduling. The Basics The Basics refers to a set of policies and mechanisms to control the order of work to be performed by a computer system. Of all the resources in a computer system that are scheduled before use, the CPU

More information

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 Thread Scheduling Operating Systems Examples Algorithm

More information

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

Operating Systems. Figure: Process States. 1 P a g e 1. THE PROCESS CONCEPT A. The Process: A process is a program in execution. A process is more than the program code, which is sometimes known as the text section. It also includes the current activity,

More information

TDIU25: Operating Systems II. Processes, Threads and Scheduling

TDIU25: Operating Systems II. Processes, Threads and Scheduling TDIU25: Operating Systems II. Processes, Threads and Scheduling SGG9: 3.1-3.3, 4.1-4.3, 5.1-5.4 o Process concept: context switch, scheduling queues, creation o Multithreaded programming o Process scheduling

More information

Multitasking and scheduling

Multitasking and scheduling Multitasking and scheduling Guillaume Salagnac Insa-Lyon IST Semester Fall 2017 2/39 Previously on IST-OPS: kernel vs userland pplication 1 pplication 2 VM1 VM2 OS Kernel rchitecture Hardware Each program

More information

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

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science Table of Contents 1. Introduction...1 2. CPU Scheduling Overview...1 3. Processes

More information