Cpr E 308 Spring 2004 Real-time Scheduling Provide time guarantees Upper bound on response times –Programmer’s job! –Every level of the system Soft versus.

Slides:



Advertisements
Similar presentations
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
Advertisements

Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Basic Operating System Concepts
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Deadlocks Tore Larsen With slides from T. Plagemann, C. Griwodz, K. Li, A. Tanenbaum and M. van Steen.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Chapter 2: Processes Topics –Processes –Threads –Process Scheduling –Inter Process Communication (IPC) Reference: Operating Systems Design and Implementation.
The ‘deadlock’ conditions Reviewing some key points concerning the potential for ‘deadlock’ in an operating system.
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
1 Concurrency: Deadlock and Starvation Chapter 6.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Concurrency: Deadlock and Starvation Chapter 6.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
General What is an OS? What do you get when you buy an OS? What does the OS do? What are the parts of an OS? What is the kernel? What is a device.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Processes and Threads.
CS 153 Design of Operating Systems Spring 2015 Midterm Review.
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Chapter 1 Computer System Overview Sections 1.1 to 1.6 Instruction exe cution Interrupt Memory hierarchy Cache memory Locality: spatial and temporal Problem.
1 Deadlocks 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order Suppose.
Operating Systems 软件学院 高海昌 Operating Systems Gao Haichang, Software School, Xidian University 22 Contents  1. Introduction** 
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
CSE 451: Operating Systems Section 5 Midterm review.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Review for Quiz-2 Applied Operating System Concepts Chap.s 1,2,6,7 - ECE3055b, Spring 2005.
Exam Review Andy Wang Operating Systems COP 4610 / CGS 5765.
Silberschatz and Galvin  Chapter 3:Processes Processes –State of a process, process control block, –Scheduling of processes  Long term scheduler,
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
CS333 Intro to Operating Systems Jonathan Walpole.
1 Processes and Threads Part II Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Sarah Diesburg Operating Systems COP 4610
Applied Operating System Concepts -
ITEC 202 Operating Systems
Chapter 2 Scheduling.
Lecture 42: Review for Final Exam
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Midterm review: closed book multiple choice chapters 1 to 9
COMS Prelim 1 Review Session
Lecture 2 Part 2 Process Synchronization
Review: Readers-Writers Problem
Concurrency: Mutual Exclusion and Process Synchronization
Major Topics in Operating Systems
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
February 5, 2004 Adrienne Noble
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Introduction to Deadlocks
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
CSE 153 Design of Operating Systems Winter 2019
CSE 542: Operating Systems
CSE 542: Operating Systems
Sarah Diesburg Operating Systems CS 3430
Presentation transcript:

Cpr E 308 Spring 2004 Real-time Scheduling Provide time guarantees Upper bound on response times –Programmer’s job! –Every level of the system Soft versus hard real-time –Streaming mp3 player versus air-traffic controller

Cpr E 308 Spring 2004 Real-time Scheduling Is this set of processes schedulable? –A: once every 100ms, 20ms CPU time –B: once every 200ms, 80ms CPU time –C: once every 100ms, 50ms CPU time If schedulable, still have to draw up a schedule for the processes

Cpr E 308 Spring 2004 CPU Scheduling: Summary FCFS Shortest job first, shortest remaining job next Round robin – context switch overhead Priority scheduling –Multi-level queues –Lottery Scheduling Real-time schedule - schedulability

Cpr E 308 Spring 2004 Deadlocks Can occur when multiple processes want multiple resources simultaneously Is this a deadlock? –Too many people, too few chairs –Two processes, A and B Process A in memory, blocking on a mutex Process B not in memory, holding the mutex Let’s be more precise

Cpr E 308 Spring 2004 Deadlock (a)A potential deadlock. (b) an actual deadlock. What are the resources here?

Cpr E 308 Spring 2004 Four Conditions for Deadlock Mutual exclusion each resource assigned to 1 process or is available Hold and wait process holding resources can request more No preemption previously granted resources cannot be forcibly taken away Circular waiting must be a circular chain of 2 or more processes each is waiting for resource held by next member of the chain

Cpr E 308 Spring 2004 Approaches to Deadlocks Ignore the problem (!!) Detection and recovery Avoidance – Banker’s algorithm Prevention – impose an order on the resources

Cpr E 308 Spring 2004 Recap for midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy

Cpr E 308 Spring 2004 Recap (2) What’s a process? –Unix Process Creation (fork) –Shell Assignment (fork and exec) Address Space –Stack, heap, data and text regions What data items go where? –What do fork() and exec() do to the address space

Cpr E 308 Spring 2004 System Calls How are they handled? –How are they different from regular function calls? –Changing from user to supervisor mode and back Some important system calls (including wait())

Cpr E 308 Spring 2004 Multiprogramming What is it? Process Context (compare with thread context) Process Context Switch How are interrupts involved?

Cpr E 308 Spring 2004 Threads When are they useful? When are they not useful? Difference from processes Basic thread operations – creation, joining, exiting, etc What do different threads in a process share, what don’t they share?

Cpr E 308 Spring 2004 Mutual Exclusion and Synchronization What’s the problem with writing to shared variables simultaneously? Why do we need critical sections? –What is atomicity? Mutual Exclusion Problem – Clear definition

Cpr E 308 Spring 2004 Mutex solutions Software Solutions –Peterson’s solution Hardware Support –TSL instruction Disabling Interrupts –Advantages and disadvantages –Doesn’t work for multiprocessors – why?

Cpr E 308 Spring 2004 Beyond Mutexes Semaphores Producer and Consumer Readers and Writers Dining Philosophers – Deadlocks

Cpr E 308 Spring 2004 Threads Implementations User and Kernel threads, pros and cons Process Scheduling –FCFS, Shortest Job First, etc. –Round robin scheduling –Priority Scheduling –Lottery Scheduling