B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.

Slides:



Advertisements
Similar presentations
Real Time Scheduling.
Advertisements

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Priority Inheritance and Priority Ceiling Protocols
Priority INHERITANCE PROTOCOLS
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
B. RAMAMURTHY 4/13/2015 cse321-fall2014 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
0 Synchronization Problem Resource sharing –Requires mutual exclusion –Critical section A code section that should be executed mutually exclusively by.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
CSE 522 Real-Time Scheduling (3)
Real-time concepts Lin Zhong ELEC424, Fall Real time Correctness – Logical correctness – Timing Hard vs. Soft – Hard: lateness is intolerable Pass/Fail.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Big Picture Lab 4 Operating Systems Csaba Andras Moritz.
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
1 Multiprocessor and Real-Time Scheduling Chapter 10.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
1 Multiprocessor and Real-Time Scheduling Chapter 10.
Project 2 – solution code
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
SYNCHRONIZATION Module-4. scheduling Scheduling is an operating system mechanism that arbitrate CPU resources between running tasks. Different scheduling.
Chapter 10 Multiprocessor and Real-Time Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Chapter 10 Multiprocessor and Real-Time Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Multiprocessor and Real-Time Scheduling Chapter 10.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems Operating systems. 1.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
RTOS task scheduling models
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Introduction to Embedded Systems Rabie A. Ramadan 5.
Chapter 19: Real-Time Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 19: Real-Time Systems System Characteristics.
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
CS333 Intro to Operating Systems Jonathan Walpole.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
3/1/2016Page 1 Realtime System Fundamentals : Scheduling B. Ramamurthy.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Big Picture Lab 4 Operating Systems C Andras Moritz
Real-Time Threads Time dependent, usually wrt deadline –Periodic –Aperiodic –Sporadic Priority scheduled Fault tolerant.
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Real-Time Operating Systems RTOS For Embedded systems.
REAL-TIME OPERATING SYSTEMS
COT 4600 Operating Systems Fall 2009
Scheduling and Resource Access Protocols: Basic Aspects
Background on the need for Synchronization
Applied Operating System Concepts -
Unit OS9: Real-Time and Embedded Systems
EEE 6494 Embedded Systems Design
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy 11/22/2018.
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
TDC 311 Process Scheduling.
Realtime System Fundamentals
Lecture 2 Part 2 Process Synchronization
Realtime System Fundamentals
Multiprocessor and Real-Time Scheduling
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
Realtime System Fundamentals
CHAPTER 8 Resources and Resource Access Control
Presentation transcript:

B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1

Realtime scheduling 12/25/2015 We will realtime system scheduling as in:  Earliest deadline scheduling (EDS)  Starting deadline  Completion deadline  Dynamic priority scheduling  Rate monotonic scheduling (RMS)  Periodic tasks are prioritized by the frequency of repetition (high priority to tasks with shorter periods)  Preemptive scheduling  Fixed priority scheduling  Schedulability according to RMS Σ(C i /T i ) <= n(2 1/n -1)  Cyclic executives (pre-scheduled)  Concepts of cycle, slot and frame  Repeated execution  times Pag e 2

Motivating Problem You are building a realtime system PLTO to send on a mission to Pluto and beyond. Consider three periodic tasks t1, t2, and t3 with {cpu time, period} as {40, 100}, {75, 300} and {50, 200} respectively. Examine the schedulability of these tasks on a processor in the system PLTO. (This problem may be equally applicable to a system in a modern automobile.) 12/25/2015 Pag e 3

12/25/2015 Task State Diagram Ready Blocked New Run Task admitted Resources allocated Dispatched; cpu allocated Waiting for event Event occurred Task exit Page 4

Deadline driven scheduling 12/25/2015 Parameters: ready time, starting deadline, completion deadline, processing time, resource requirement, priority, preemptive or non-preemptive Pag e 5

Deadline Scheduling (periodic tasks) 12/25/2015 Process Arrival Time Execution Time Ending Deadline A(1) A(2) A(3) A(4) A(5) B(1) B(2) Pag e 6

12/25/2015 Page 7 deadline A1 B1 A2 B1 A3 B2 A4 B2 A5 B2 A1 A2 B1 A3 A4 A5, B2 (missed) A1 (missed) A2 A3 A4 (missed) A5, B2 B1 A2 A3 B2 A5 A1 A2 B1 A3 A4 A5, B2 A1 B1 A2 B1 A3 B2 A4 B2 A5 Fixed-priority scheduling; A has priority Fixed-priority scheduling; B has priority Earliest-deadline scheduling using completion deadlines B1

Aperiodic Task set 12/25/2015 Pag e 8 Arrival Time Execution Time Starting Deadline A B C D E Use earliest deadline with unforced idle time

Rate-monotonic scheduling 12/25/2015 Pag e 9 First proposed by Liu. For RMS, the highest-priority task is the one with the shortest period, the second highest-priority task is the one with the second shortest period, and so on. Schedulability according to RMS Σ(C i /T i ) <= n(2 1/n -1)

Critical sections and Semaphores 12/25/2015 When multiples tasks are executing there may be sections where only one task could execute at a given time: critical region or critical section There may be resources which can be accessed only be one of the processes: critical resource Semaphores can be used to ensure mutual exclusion to critical sections and critical resources Pag e 10

Resources & Critical Resources 12/25/2015 Shared resources: need mutual exclusion Tasks cooperating to complete a job Tasks contending to access a resource Tasks synchronizing Critical resources and critical region A important synchronization and mutual exclusion primitive / resource is “semaphore” Pag e 11

Pthread and mutex 1. #include 2. Declare mutex variable global to the threads, functions pthread_mutex_t mtx; // declare 3. pthread_mutex_init(&mtx, NULL); //initialize 4. Identify critical section within thread; use mutex to realize mutual exclusion pthread_mutex_lock(&mtx); // code for critical section pthread_mutex_unlock(&mtx); 5. Destroy mutex before exiting the program; pthread_mutex_destroy(&mtx); 12/25/2015 Pag e 12

Priority Inversion 12/25/2015 When we allow concurrent task to execute and with semaphore and mailboxes and other synchronization primitives, it is possible that a low priority task may come to block a high priority task. This situation is known as priority inversion. What happened on Mars? Pag e 13

Priority inversion (Priority: t1>t2>t3) 12/25/2015 task3 task2 Critical section task1 time blocked Pag e 14

Problem: Priority inversion Solution1: Priority Inheritance 12/25/2015 task3 task2 Critical section task1 time blocked Priority of t1 inherited Task 2 delayed Priority reverted To t3 Pag e 15

Solution2:Priority Ceiling Protocol CSUsed by Priority Ceiling S1t1,t2P(t1) S2t1,t2,t3P(t1) S3t3P(t3) 12/25/2015 Critical section task1 time task2 task3 Acquire S2 Attempt to Acquire S1 Acquire S2 Release S1 Release S2 No way Pag e 16