D. Kalinsky Associates
  Home  |  Training Courses  |  Online Learning  |  Resources  |  About Us  |  Contact  |  Site Map  
Online Training Session:         Messages for Intertask Communication
How does a Task Send a Message?
1.  Define Content and Structure of the Message
•  Make Sure Sender and Receiver Tasks have Same Definition
2.  Allocate a Buffer for Message of appropriate size
3.  Fill in the Data Payload of the Message
4.  Send the Message
•  “Indirect” Message Passing RTOSs: Send to a predefined Queue
•  “Direct” Message Passing RTOSs: Send to Receiver Task
5.  Make Sure the Buffer is eventually Freed
•  “Indirect” Message Passing RTOSs: Sender Task frees buffer
•  “Direct” Message Passing RTOSs: Receiver Task frees buffer
Previous                    Page 7 of 9                 Next
NOTES:

This is a 5-step "cookbook" for what to do to program a task to send a message.  The details are slightly different for
different off-the-shelf RTOSs and RTOS categories.

FOR  INDIRECT  MESSAGE PASSING RTOSs
1.  Define Content and Structure of the Message
•  Make Sure Sender and Receiver Tasks have Same Definition
2.  Allocate a Buffer for Message of appropriate size
3.  Fill in the Data Payload of the Message
4.  Send the Message to a predefined Queue
5.  Make Sure the Buffer is eventually Freed by the Sender Task

FOR  DIRECT  MESSAGE PASSING RTOSs
1.  Define Content and Structure of the Message
•  Make Sure Sender and Receiver Tasks have Same Definition
2.  Allocate a Buffer for Message of appropriate size
3.  Fill in the Data Payload of the Message
4.  Send the Message to the Receiver Task
5.  Make Sure the Buffer is eventually Freed by the
Receiver Task
•  Sender Task does
not free buffer (when message is passed by pointer)
© Copyright 2010, D. Kalinsky Associates, All Rights Reserved.
This page Updated J
anuary 1, 2010