Chapter 3 RTOS Concepts And Definitions Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang.

Slides:



Advertisements
Similar presentations
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Advertisements

Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 3 – Process Concepts Outline 3.1 Introduction 3.1.1Definition of Process 3.2Process States:
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
ARM Exception Handling
Operating System Process Scheduling (Ch 4.2, )
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Introduction To The ARM Microprocessor
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
Chapter 11 Operating Systems
Operating Systems Process Scheduling (Ch 4.2, )
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Chapter 6 Real-Time Embedded Multithreading The Thread – The Essential Component.
MicroC/OS-II Embedded Systems Design and Implementation.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Operating System Process Scheduling (Ch 4.2, )
Chapter 1 Embedded And Real-Time System Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang.
Outline Introduction to MQX Initializing and starting MQX
Advanced Embedded Systems Design Pre-emptive scheduler BAE 5030 Fall 2004 Roshani Jayasekara Biosystems and Agricultural Engineering Oklahoma State University.
Introduction to Embedded Systems
Chapter 5: CPU Scheduling (Continuation). 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Determining Length.
SOC Consortium Course Material SoC Design Laboratory Lab 8 Real-time OS - 2 Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department.
Real-Time Kernel (Part 1)
Operating Systems Lecture 09: Threads (Chapter 4)
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Chapter 6 CPU SCHEDULING.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Using ThreadX ® and IAR Embedded Workbench on the.
Scheduling Algorithms. A computer system has limited resources that must be shared among the processes competing for those resources. A computer system.
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 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 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
The Stack This is a special data structure: –The first item to be placed into the stack will be the last item taken out. Two basic operations: –Push: Places.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
RTOS task scheduling models
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Processes & Threads Introduction to Operating Systems: Module 5.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Outlines  Introduction  Kernel Structure  Porting.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Real-Time Operating Systems RTOS For Embedded systems.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
OPERATING SYSTEMS CS 3502 Fall 2017
Real time systems RTS Engineering.
Applied Operating System Concepts -
OPERATING SYSTEMS CS3502 Fall 2017
Chapter 3 – Process Concepts
Chapter 6: CPU Scheduling
Structure of Processes
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Threads Chapter 4.
Computer System Overview
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Presentation transcript:

Chapter 3 RTOS Concepts And Definitions Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang

Outline(1/2) Priorities Ready threads and suspended threads Preemptive, priority-based scheduling Round-Robin scheduling Kernel 、 RTOS Context Switch

Outline(2/2) Interrupt handling 、 Thread starvation Priority inversion Priority inheritance Preemption-threshold

Priorities(1/2) Most real-time systems use a priority system as a means of establishing the relative importance of threads. Priorities include two classes Static priority Dynamic priority ThreadX provides priority values from 0 to 31,the value 0 represents the highest priority

Priorities(2/2)

Ready threads and suspended threads(1/3) ThreadX maintains to manage threads two classes Suspended Threads List Occur Wait for an unavailable resource Removed It is placed on the Ready Thread List It is terminated

Ready threads and suspended threads(2/3)

Ready threads and suspended threads(3/3) Ready Threads List Occur Thread is ready for execution Remove When ThreadX schedules a thread for execution If all the threads on the list have equal priority,ThreadX selects the thread that has been waiting the longest.

Preemptive, priority-based scheduling A higher priority thread can interrupt and suspend a currently executing thread that has a lower priority

Round-Robin scheduling Provide processor sharing in the case in which multiple threads have the same priority Two primary ways are supported by ThreadX : Round-robin processing and cooperative multithreading

Round-Robin scheduling

Kernel 、 RTOS A kernel is minimal implementation of an RTOS Consists of at least a scheduler and a context switch handler Full-blown operating systems RTOS is dedicated to the control of hardware and must operate within specified time contraints

Context Switch Context is the current execution state of a thread Consists of such items as the program counter,register and stack pointer Context switch refers to the saving or restoring a different thread ’ s When a thread ’ s context is restored then the thread resumes execution at the stopping point

Interrupt handling 、 Thread starvation Interrupt handling Interrupt vector Interrupt service routine (ISR) Thread starvation Priority-based scheduling Solution would be to gradually raise the priority of starved

Priority inversion

Preemption-threshold Disabling preemption Threads with priorities higher than 15 will be permitted Even though priorities 15 through 19 are higher than thread ’ s priority of 20,threads with those priorities will not be allowed to preempt this thread