8 - Memory management
Real time systems need to exchange information. The best way to do so is to have a reserved chunk of shared memory that several tasks can access. SDL-RT implicitly runs on such an underlying architecture since it supports global variables and exchanges message parameters through pointers. That raises memory management rules to follow to ensure a proper design.
8.1 - Global variables
SDL-RT processes can share global variables. This is very powerful but also very dangerous since the data can be corrupted if manipulated without caution. It is strongly recommended to use semaphores to access global variables to be sure data is consistent. An example of such a design is given later in this document.
8.2 - Message parameters
Parameters of a message are passed through a pointer. This implies the data pointed by the sending process will be accessible by the receiving process. Therefore a good design should meet the following rules: