SE3910 Week 8, Class 3 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 9 Lab: Individual demos of working sub-modules.

Slides:



Advertisements
Similar presentations
SE2811 Week 8 Monday (last drop day) The Command Pattern Lambda Expressions SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr.
Advertisements

Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
© Copyright 2004 Dr. Phillip A. Laplante 1 Kernel Architectures  Polled Loop  Synchronized Polled Loop  State-Based Model  Cyclic Executives  Foreground/Background.
RTOS Concepts and Defn From Pseudokernels to Operating Systems
SE3910 Week 2, Class 2 Today Real-Time Systems Embedded Systems Other ??? Week 3 Tuesday Lab Lab start TBA SE-2811 Slide design: Dr. Mark L. Hornick Content:
Week 3, Day 1: Processes & Threads Return Quiz Processes Threads Lab: Quiz Lab 3: Strategy & Factory Patterns! SE-2811 Slide design: Dr. Mark L. Hornick.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Week 3, Day 1: Processes & Threads Processes Threads SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Scheduling policies for real- time embedded systems.
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Lost-and-not-found power supply – Quick-Quiz (Ungraded) – Use interrupts in a Linux/C.
CS2910 Week 1, Class 3 Today Lab 1 – Additional Assignment Working Ahead Primitives in Java SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder.
CS2852 Week 2, Class 1 Today Generics (Section 051) Big-O runtime analysis Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See.
Today Quiz Multithreading Options Qt socket buffers between threads Quiz today & Tuesday in lab SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
CS-1030 Dr. Mark L. Hornick 1 Java Review Interactive.
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE-3910 Real-time Systems Week 1, Class 2 – Fine Print – Web page available – Review Quiz 0 – What is a Real-Time Embedded System? Embedded & Real-Time.
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
Today Return Quiz First release of final project template Multithreading Options Qt socket buffers between threads Tomorrow: Quiz Interthread communication.
Today Final Project “Preview” Real-time concurrency Multithreading Options pthreads qthreads GPIO.h & GPIO.cpp Quiz tomorrow & Tuesday in lab SE-2811 Slide.
Today Return Quiz First true release of final project (Lab 8) Multithreading Options Qt socket buffers between threads SE-2811 Slide design: Dr. Mark L.
Today Quiz not yet graded Final report requirements posted More on Multithreading Happens-Before in Java SE-2811 Slide design: Dr. Mark L. Hornick Content:
Today Signals Nyquist Theorem (revisited) Audio Sampling Latency and Bandwidth Scheduling Theory SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Today Quiz not yet graded (Sorry!) More on Multithreading Happens-Before in Java Other langauges with Happens-Before Happens-Before in C++ SE-2811 Slide.
CS2910 Week 6, Lab Today Dictionaries in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
SE3910 Week 1, Class 1 Today – Introductions The students (informally) The instructor Safety Review Policy The course Tomorrow (If you are in that section)
Real-Time Operating Systems RTOS For Embedded systems.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Slide design: Dr. Mark L. Hornick
Process Tables; Threads
SE-3910 Real-time Systems Week 10, Class 3 Loop jamming
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Real time systems RTS Engineering.
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
SE-2811 Software Component Design
Unit OS9: Real-Time and Embedded Systems
Polling vs. Interrupts CS2852 9/18/2018
Chapter 6: CPU Scheduling
RTS: Kernel Design and Cyclic Executives
Chapter 6: CPU Scheduling
Process Tables; Threads
RTS: Kernel Design 11/30/2018.
Week 7, Class 1: The Command Pattern (cont.)
Chapter 2: The Linux System Part 3
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design 1/2/2019.
RTS: Kernel Design and Cyclic Executives
Slide design: Dr. Mark L. Hornick
Processes and operating systems
Chapter 4 Threads, SMP, and Microkernels
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Polling vs. Interrupts CS2852 4/9/2019
Polling vs. Interrupts CS2852 4/21/2019
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
SE-3910 Real-time Systems Week 4, Class 1 Quick-Quiz (Ungraded!)
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Presentation transcript:

SE3910 Week 8, Class 3 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 9 Lab: Individual demos of working sub-modules Modules that will communicate should use those interfaces during the tests Today Rate Monotonic Scheduling SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1

Textbook references This material comes from Chapter 4 of our custom text Chapter 3 of Laplante & Ovaska, Real-Time Systems Design and Analysis, 4 th ed. SE-2811 Dr.Yoder 2

Today Take Quiz Rate Monotonic Analysis More on Multithreading Happens-Before in Java SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 3 SE3910 Week 8, Class 3

Predicting CPU usage τ i – task i p i – period i (ms) e i – execution time (ms) u i -- %CPU used for task i SE-2811 Dr.Yoder 4

Predicting CPU usage (2) SE-2811 Dr. Yoder 5

In-Class Exercise Calculation: What is the processor utilization for this problem? Based on RMA, what order will they execute and how will they execute? Hints: Draw release times, break up processing into multiple frames if needed. SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 6

Rate-Monotonic Example SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 7

Simplifying Assumptions needed for RMS All tasks in the task set considered are strictly periodic. The relative deadline of a task is equal to its period. All tasks are independent; there are no precedence constraints. No task has any nonpreemptible section, and the cost of preemption is negligible. Only processing requirements are significant; memory and I/O requirements are negligible. SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 8

Scheduling Definitions Laplante and Ovaske 4E p. 98 9

(cont.) SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 10

More on the Rate Monotonic Analysis Why is it called Rate Monotonic? When is RMA guaranteed to work? SE-2811 Dr.Yoder 11

Why is it called Rate Monotonic? What do you think of when you hear the word monotonic? SE-2811 Dr.Yoder 12

When is Rate Monotonic Guaranteed to work? 13

Building your own micro- kernel You may choose to run really light-weight because You want the system to be more predictable To minimize overhead In this case, you can write your own super- simple OS or micro-kernel. Here are a few varieties SE-2811 Dr.Yoder 14

Micro-kernel: Simple polled loop int main(int argc, char **argv) { while(true) { if(packet_here) { process_data(); packet_here = 0; } SE-2811 Dr.Yoder 15

Micro-kernel: Polled loop with delay int main(int argc, char **argv) { while(true) { if(packet_here) { process_data(); pause(21); // ms packet_here = 0; } SE-2811 Dr.Yoder 16

Micro-kernel: Cyclic code structure int main(int argc, char **argv) { while(true) { task1(); task2(); task3(); } SE-2811 Dr.Yoder 17 (Not to be confused with Cyclic Code Scheduling )

Micro-kernel: Cyclic code structure with high-rate task 2 int main(int argc, char **argv) { while(true) { task1(); task2(); task3(); task2(); } SE-2811 Dr.Yoder 18

Micro-kernel: Co-routines void task1() { // called from a cyclic loop like // previous slide if(state == state1) { phase1_1(); } else if(state == state2) { phase1_2(); } else if(state == state3) { phase1_3(); } /* task 2 is similar... */ SE-2811 Dr.Yoder 19 This implements a state machine. Co-routines require a great deal of discipline to write correctly. Ada has constructs to help…

Micro-kernel: Interrupt-driven int main(int argc, char **argv) { while(true) {/* idle loop */} } void int1() { saveContext(); work1(); restoreContext(); } void int2() { saveContext(); work2(); restoreContext(); } void int3() { saveContext(); work3(); restoreContext(); } 20

What to do if a second interrupt occurs? Disable interrupts Interrupt the interrupt… "Preemptive priority" SE-2811 Dr. Yoder 21

Micro-kernel: Foreground- background System int main(int argc, char **argv) { while(true) { do_low_priority(); } void int1() { saveContext(); work1(); restoreContext(); } void int2() { saveContext(); work2(); restoreContext(); } void int3() { saveContext(); work3(); restoreContext(); } 22

Foreground-background systems Note this is the most general type of system. Depending on what code we use for do_low_priority() and for the int1(), int2(), etc methods, we can implement any of the other systems, even the co-routines one. (For those without interrupts, there aren't interrupt routines) (For the pure interrupt approach, we use an empty method for do_low_priority()) SE-2811 Dr. Yoder 23