4.4.3. Messages#
While a semaphore can be used to communicate the occurance of an event between to task, it can not contain more meaningful data. Instead, an RTOS typically provides messages as a service to communicate data between tasks. Depending on the RTOS, messages can be sub-divided into mailboxes and queues in the case of \(\mu\)C/OS-II.
4.4.3.1. Message mailbox#
I \(\mu\)C/OS-II, a mailbox is a special memory location that one or more tasks can use to transfer data. A mailbox can only contain one message. The following video gives a brief introduction to mailboxes.
The following video demonstrates and example of using a mailbox in \(\mu\)C/OS-II.
4.4.3.2. Message queues#
While a mailbox can only contain one message, a queue can contain multiple messages. The following video introduces queues.
The following video demonstrates an example of using queues in \(\mu\)C/OS-II.