Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University

Slides:



Advertisements
Similar presentations
Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
Advertisements

ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 6 Review I2C Communication, review fixed point arithmetic,
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Tuple Spaces and JavaSpaces CS 614 Bill McCloskey.
CSE 466 – Fall Introduction - 1 Implementation of Shared Memory  Considerations  Network traffic due to create/read/write  Latency of create/read/write.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
FreeRTOS.
ΜC/OS-III Tasks Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
1 Chapter 9 Spaces with LINDA. 2 Linda Linda is an experimental programming concept unlike ADA or Occam which are fully developed production-quality languages.
Real Time Operating System
Parallel and Distributed Simulation FDK Software.
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.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Getting Started with the µC/OS-III Real Time Kernel Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University.
Memory Management Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University.
2-1 The critical section –A piece of code which cannot be interrupted during execution Cases of critical sections –Modifying a block of memory shared by.
Scheduling in µC/OS-III Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University.
Real Time Operating Systems
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
Data Structures Using Java1 Chapter 7 Queues. Data Structures Using Java2 Chapter Objectives Learn about queues Examine various queue operations Learn.
Real Time Operating Systems Mutual Exclusion, Synchronization & Intertask Communication Course originally developed by Maj Ron Smith.
Overview Task State Diagram Task Priority Idle Hook AND Co-Routines
1 Deadlock. 2 Concurrency Issues Past lectures:  Problem: Safely coordinate access to shared resource  Solutions:  Use semaphores, monitors, locks,
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
 Wind River Systems, Inc Chapter - 7 Intertask Communication.
Processes Creation and Threads. Shared Resource Example The console is just a place where text can be printed by the application currently running. Program.
Message Passing Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University.
1 J.O. KLEIN Institut Universitaire de Technologie de CACHAN Université PARIS SUD - FRANCE An Introduction to Real Time Operating System.
Readers-Writers Problem Akos Ledeczi EECE 354, Fall 2012 Vanderbilt University.
Chapter 7: Semaphore Management Seulki Lee 1. Semaphore?  A protocol mechanism offered by most multitasking kernels  Control access to a shared resource.
2-1 Chapter 2 Real-Time Systems Concepts. 2-2 Foreground/Background Systems BackgroundForeground ISR Time Code execution application consists of an infinite.
Synchronization Akos Ledeczi EECE 6354, Fall 2013 Vanderbilt University.
WORKING OF SCHEDULER IN OS
Outline Introduction. Changes made to the Tycho design from last time (June 2005). Example Tycho setup. Tycho benchmark motivations and methodology. Some.
Getting Started with Micriμm’s μC/OS-III Kernel
Chapter 11 User Datagram Protocol
to understand recursion you must understand recursion
Processes and threads.
JCSP Tutorial & Homework Hints
Chapter 11: Message Queue Management
Chapter 3: Process Concept
PROCESS MANAGEMENT IN MACH
Multi Threading.
Topics Covered What is Real Time Operating System (RTOS)
Chapter 10: Void Functions
Interrupt and Time Management in µC/OS-III
Getting Started with the µC/OS-III Real Time Kernel
to understand recursion you must understand recursion
Concurrency: Mutual Exclusion and Synchronization
Computer System Overview
Scheduling in µC/OS-III
Inter Process Communication (IPC)
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
7.1. CONSISTENCY AND REPLICATION INTRODUCTION
Multithreading Tutorial
Process Description and Control
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Subject : T0152 – Programming Language Concept
Computer Science & Engineering Electrical Engineering
EECE.4810/EECE.5730 Operating Systems
Chapter 9: Value-Returning Functions
Ալգորիթմներ Stack, Queue, Tree.
Chapter 3: Processes.
System Software Design
Intertask Communication
Chapter 6 – Distributed Processing and File Systems
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Presentation transcript:

Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University Message Passing Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University

Message Queues Inter-task communication Usually better practice than using global variables Message queues are used to manage messages Standalone queues Each task has a built-in queue Messages are passed by reference, that is, no copy is ever made!!! Must remain in scope!!! Default is FIFO, but optionally LIFO can be used for important messaged to bypass waiting messages in the queue Multiple tasks can Pend() on a queue. Post() can optionally broadcast to all waiting tasks

Bilateral Rendezvous Using tasks queues in this case Just like semaphores, but can pass data as well

Flow Control Message producer may produce faster than consumer can consume To prevent overflowing the message queue, a semaphore helps manage the resource Using a task semaphore and a task queue in this case

Clients and servers Different tasks/ISRs (clients) report different error conditions Single error handler (“server”) processes the reports

Example Measure RPM using a hole in the disk A free running counter is used to measure the time between two hole detections ISR shouldn’t be used to compute average, maximum, etc. Task may be low priority in the system, so a message queue is used to store measurements until they can be processed

Usage API: OSQCreate() OSQPend() OSQPost() OSQFlush() OSQPendAbort() OS_Q MyQ; MyMsgData MyMsg; OSQCreate(&MyQ, “My Queue”, 10, /* max queue size */ &err); … OSQPost(&MyQ, (void *)&MyMsg, /* actual data to send */ /* DANGER: using a global */ sizeof(MyMsg), OS_OPT_POST_FIFO, OSQPend(&MyQ, 1000, /* timeout */ OS_OPT_PEND_BLOCKING, &size, &ts, if (err == OS_ERR_TIMEOUT) { API: OSQCreate() OSQPend() OSQPost() OSQFlush() OSQPendAbort() OSQDel()

Internals