Realtime System Fundamentals

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

B. RAMAMURTHY 4/13/2015 cse321-fall2014 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Intertask Communication and Synchronization In this context, the terms “task” and “process” are used interchangeably.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
Chapter 2.3 : Interprocess Communication
LAB 11: Task Synchronization Chung-Ta King National Tsing Hua University CS 4101 Introduction to Embedded Systems.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
1 Interprocess Communication (IPC) - Outline Problem: Race condition Solution: Mutual exclusion –Disabling interrupts; –Lock variables; –Strict alternation.
1 Lecture 8: Concurrency: Mutual Exclusion and Synchronization(cont.) Advanced Operating System Fall 2009.
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
Introduction to Embedded Systems Rabie A. Ramadan 5.
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
3/1/2016Page 1 Realtime System Fundamentals : Scheduling B. Ramamurthy.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 6: Process Synchronization.
Big Picture Lab 4 Operating Systems C Andras Moritz
Chapter 6 Synchronization Dr. Yingwu Zhu. The Problem with Concurrent Execution Concurrent processes (& threads) often access shared data and resources.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Deadlock and Starvation
Interprocess Communication Race Conditions
REAL-TIME OPERATING SYSTEMS
EMERALDS Landon Cox March 22, 2017.
Operating systems Deadlocks.
Chapter 6: Process Synchronization
Process Synchronization
Chapter 5: Process Synchronization
Process Synchronization: Semaphores
Scheduling and Resource Access Protocols: Basic Aspects
Auburn University COMP 3500 Introduction to Operating Systems Synchronization: Part 4 Classical Synchronization Problems.
Deadlock and Starvation
Chapter 5: Process Synchronization
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
Inter-Process Communication and Synchronization
Concurrency: Mutual Exclusion and Synchronization
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.
Topic 6 (Textbook - Chapter 5) Process Synchronization
Semaphore Originally called P() and V() wait (S) { while S <= 0
Last Week Introduced operating systems Discussed the Kernel
Synchronization Hank Levy 1.
Operating systems Deadlocks.
Realtime System Fundamentals
Lecture 2 Part 2 Process Synchronization
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
Concurrency: Mutual Exclusion and Process Synchronization
Computer Science & Engineering Electrical Engineering
CSCI1600: Embedded and Real Time Software
Chapter 6 Synchronization Principles
Realtime System Fundamentals
Final Review CSE321 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Synchronization Hank Levy 1.
CSE 153 Design of Operating Systems Winter 19
Chapter 7: Synchronization Examples
CSE 153 Design of Operating Systems Winter 2019
Chapter 6: Synchronization Tools
CSCI1600: Embedded and Real Time Software
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
Process/Thread Synchronization (Part 2)
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University
Presentation transcript:

Realtime System Fundamentals B. Ramamurthy 1/16/2019

Review of Project Plans Hardware modifications Software to generate xinu.boot Cross compiler (host system to MIPS) Fronzak 206 is ready for use David will provide you instructions to access the NEXOS setup You can use this to compile the software you write for shell and drivers and anything else you add to exinu. Uploading xinu.boot to test your shell and drivers: You can do it from any system with a serial port , hyperterminal and tftp installed. Such a setup will be available in the Franzack lab and is currently available during recitation/lecture on Tuesdays at 340 Bell. This will be available for remote access from next week 1/16/2019

Realtime scheduling We will discuss realtime system scheduling: 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 Σ(Ci/Ti) <= n(21/n-1) Cyclic executives (pre-scheduled) Concepts of cycle, slot and frame Repeated execution times 1/16/2019

Critical sections and Semaphores 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 1/16/2019

Semaphores See semaphore.h of xinu 1/16/2019

Priority Inversion 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. 1/16/2019

Priority inversion (Priority: t1>t2>t3) Critical section task1 time 0 1 2 3 4 5 6 7 8 9 10 blocked task2 task3 1/16/2019

Priority Ceiling Protocol CS Used by Priority Ceiling S1 t1,t2 P(t1) S2 t1,t2,t3 S3 t3 P(t3) Acquire S1 Release S1 task1 Attempt to Acquire S1 Acquire S1 Acquire S2 No way task2 Acquire S2 Release S2 Critical section task3 0 1 2 3 4 5 6 7 8 9 10 time 1/16/2019

Inter-task communication and synchronization Buffering data: For inter-task communication For sending data To handle incompatibilities between tasks typically a buffer is introduced Classical buffer Double buffer Ring buffer Mail boxes 1/16/2019

Mailboxes Mailboxes are intertask communication device available in many commercial operating systems. A mailbox is a memory location that one or more tasks can use to pass data or for synchronization. post and pend are used for mailbox write and read 1/16/2019

Mailbox implementation List of tasks and needed resources (mailboxes, printers etc.) is kept along with a second table of list of resources and their state taskID Resource Status 100 printer Has it 102 Mailbox 1 104 Mailbox 2 pending resource status owner printer busy 100 Mailbox 1 102 Mailbox 2 empty none 1/16/2019

Mailbox implementation (contd.) Task 104 requests mailbox 2 “pend” or “read”; It blocks waiting for read. Operating system checks task table, if “key” is full or available for mailbox 2, then it unblocks Task 104 and lets it read from mailbox 2; Task 104 reads from mailbox 2 and set it “key” back to empty. Accept is another function for mailbox; it is a non-blocking call; it reads data if available or it fails 1/16/2019

Task states Ready, running and blocked Critical regions Semaphores for protection of critical regions Identify the critical region and enclose it with p() and v() operators of the semaphore Lets look at an example of implementation of mailboxes using semaphores 1/16/2019

Mailboxes using semaphores Semaphore mutex, proc_sem; Bool full, empty; void post(int mailbox, int message) { wait(mutex); if (empty_slots){ insert(mailbox, message); update; signal(mutex); signal(proc_sem); } else {// no empty slots; wait for empty slots wait(proc_sem); wait(mutex); insert(mailbox,message); update(); signal(proc_sem); } 1/16/2019

Mailboxes using semaphores void pend(int *mailbox, int *message) { wait(mutex); if (full_slots) { extract(mailbox, message); update(); signal(mutex); } else { .. signal(mutex); wait(proc_sem); extract(mailbox,message); } 1/16/2019