Priority Inversion Higher priority task is blocked by a lower priority one. May be caused by semaphore usage, device conflicts, bad design of interrupt.

Slides:



Advertisements
Similar presentations
Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
Advertisements

Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
1 Threads. 2 Real Life Example?  Process  “system programming” course  Different from “internet engineering”  Thread  homework, Reading, Self-assessment.
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Chapter 13 Embedded Systems
Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Threads Threads are lightweight processes
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Chapter 13 Embedded Systems
8-1 JMH Associates © 2004, All rights reserved Windows Application Development Chapter 10 - Supplement Introduction to Pthreads for Application Portability.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Performance Evaluation of Real-Time Operating Systems
RTOS Design & Implementation Swetanka Kumar Mishra & Kirti Chawla.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
UNIX System Administration OS Kernal Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept Kernel or MicroKernel Concept: An OS architecture-design.
Tittle:Real Time Linux
Real Time Operating Systems Lecture 10 David Andrews
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
1 Threads Chapter 11 from the book: Inter-process Communications in Linux: The Nooks & Crannies by John Shapley Gray Publisher: Prentice Hall Pub Date:
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Real-Time Linux Evaluation NASA Glenn Research Center Kalynnda Berens Richard Plastow
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
June-Hyun, Moon Computer Communications LAB., Kwangwoon University Chapter 26 - Threads.
Multi-threaded Programming with POSIX Threads CSE331 Operating Systems Design.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Real-Time, Clocking, and Porting (My Job ) Determining the Real Time Capabilities of various Operating Systems. Writing code to support Real Time Clocking.
1 Pthread Programming CIS450 Winter 2003 Professor Jinhua Guo.
POSIX Synchronization Introduction to Operating Systems: Discussion Module 5.
UNIX Unit 1- Architecture of Unix - By Pratima.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Unix Internals Concurrent Programming. Unix Processes Processes contain information about program resources and program execution state, including: Process.
Challenges in Porting & Abstraction. Getting Locked-In Applications are developed with a particular platform in mind The software is locked to the current.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Thread Basic Thread operations include thread creation, termination, synchronization, data management Threads in the same process share:  Process address.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Real-Time Operating Systems RTOS For Embedded systems.
Mgr inż. Marcin Borkowski UNIX POSIX Threads. mgr inż. Marcin Borkowski Introduction to Threads ● Threads provide different (to processes) method to compute.
Introduction to Operating Systems Concepts
Introduction to Real-Time Operating Systems
REAL-TIME OPERATING SYSTEMS
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Topics Covered What is Real Time Operating System (RTOS)
EEE 6494 Embedded Systems Design
Real Time Operating Systems for Networked Embedded Systems
Real-time Software Design
Lecture 14: Pthreads Mutex and Condition Variables
Operating System Concepts
CS703 - Advanced Operating Systems
Real-Time Operating Systems
Threads Chapter 4.
Lecture 2 Part 2 Process Synchronization
Pthread Prof. Ikjun Yeom TA – Mugyo
Lecture 14: Pthreads Mutex and Condition Variables
Concurrency and Threading: Introduction
RTOS Modelling Naren Bala.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Priority Inversion Higher priority task is blocked by a lower priority one. May be caused by semaphore usage, device conflicts, bad design of interrupt handlers, poor programming and system design.

Problems with Priority Inheritance Nested critical regions –PI protected critical regions should not contain inheriting blocking operations Mixed inheriting and non-inheriting operations –PI protected critical regions should not contain non-inheriting blocking operations either Performance –PI protected critical regions must be relatively costly in terms of compute time or they perform worse than the simplest alternative (disable all preempts during the critical region). Operating system performance –PIP adds significant complexity to the operating system

Other Solutions to Priority Inversion Make the operation using the resource atomic and fast Remove the contention Explicitly schedule the operations according to priority

RT O/S Strategies Add non-real-time services to a real-time kernel (e.g., VXworks, QNX) Modify a standard kernel to make it pre- emptable (e.g., RT-IX) A simple real-time executive runs a non-real- time kernel as its lowest priority task, using a virtual machine layer to make the standard kernel pre-emptable (e.g., RT-Linux)

RT-Linux Approach to Real-Time RT kernel runs non-RT Linux as the lowest priority Interrupts are handled by the RT kernel and passed to the Linux task when no RT tasks Software emulates the interrupt control hardware for non-RT Linux –Interrupts are queued up

RT-Linux Approach to Real-Time RT and non-RT tasks communicate through lock-free queues and shared memory –Queues accessed like character devices via POSIX read/write/ioctl calls –Shared memory accessed via POSIX mmap calls Non-RT Linux used for –Booting, device drivers, networking, file systems, Linux process control

RT-Linux Approach to Real-Time Worst case interrupt latency on 486/33 Mhz PC is < 30 microsec Example application: data acquisition –RT task with polling or interrupts –Non-RT task for logging, display, networking –Queue to transfer data from RT task to non-RT task

RT-Linux Approach to Real-Time Design premise 1: Keep the RT kernel simple –No dynamic memory allocation –No address space protection –Fixed priority scheduler –No protection against impossible schedules –Synchronization between RT tasks with hard interrupt disabling and shared memory –FIFO queues connect RT tasks to non-RT tasks –Use non-RT Linux for other operations

RT-Linux Approach to Real-Time Design premise 2: Keep RT kernel flexible –Modules can be replaced E.g., alternative scheduling (EDF, RM) E.g., semaphore module –Runtime reconfigurable E.g., Can run tests with different scheduling

What is POSIX? (Ch. 10, Shaw) IEEE’s Portable Operating System Interface for Computer Environments, which supports: Threads Mutexes Semaphores Shared Memory Messages Signals Clocks & Timers Asynchronous I/O Memory Locking

POSIX.1c function calls pthread_atfork pthread_attr_destroy pthread_attr_getdetachstate pthread_attr_getinheritsched pthread_attr_getschedparam pthread_attr_getschedpolicy pthread_attr_getscope pthread_attr_getstackaddr pthread_attr_getstacksize pthread_attr_init pthread_attr_setdetachstate pthread_attr_setinheritsched pthread_attr_setschedparam pthread_attr_setschedpolicy pthread_attr_setscope pthread_attr_setstackaddr pthread_attr_setstacksize pthread_cancel pthread_cleanup_pop pthread_cleanup_push pthread_condattr_destroy pthread_condattr_getpshared pthread_condattr_init pthread_condattr_setpshared pthread_cond_broadcast pthread_cond_destroy pthread_cond_init pthread_cond_signal pthread_cond_timedwait pthread_cond_wait

POSIX.1c function calls pthread_create pthread_detach pthread_equal pthread_exit pthread_getschedparam pthread_getspecific pthread_join pthread_key_create pthread_key_delete pthread_kill pthread_mutexattr_destroy pthread_mutexattr_getprioceiling pthread_mutexattr_getprotocol pthread_mutexattr_getpshared pthread_mutexattr_init pthread_mutexattr_setprioceiling pthread_mutexattr_setprotocol pthread_mutexattr_setpshared pthread_mutex_destroy pthread_mutex_init pthread_mutex_lock pthread_mutex_trylock pthread_mutex_unlock pthread_once pthread_self pthread_setcancelstate pthread_setcanceltype pthread_setschedparam pthread_setspecific pthread_sigmask pthread_testcancel