Hardware Reference
In-Depth Information
10.6
INTERTASK COMMUNICATION MECHANISMS
Intertask communication is a critical issue in real-time systems, even in a uniprocessor
environment. In fact, the use of shared resources for implementing message passing
schemes may cause priority inversion and unbounded blocking on tasks' execution.
This would prevent any guarantee on the task set and would lead to a highly unpre-
dictable timing behavior.
In this section, we discuss problems and solutions related to the most typical commu-
nication semantics used in operating systems: the synchronous and the asynchronous
model.
In the pure synchronous communication model, whenever two tasks want to commu-
nicate they must be synchronized for a message transfer to take place. This synchro-
nization is called a rendez-vous . Thus, if the sender starts first, it must wait until the
recipient receives the message; on the other hand, if the recipient starts first, it must
wait until the sender produces its message.
In a dynamic real-time system, synchronous communication schemes easily lead to
unpredictable behavior, due to the difficulty of estimating the maximum blocking time
for a process rendez-vous . In a static real-time environment, the problem can be solved
off-line by transforming all synchronous interactions into precedence constraints. Ac-
cording to this approach, each task is decomposed into a number of subtasks that
contain communication primitives not inside their code but only at their boundary.
In particular, each subtask can receive messages only at the beginning of its execution
and can send messages only at the end. Then a precedence relation is imposed between
all adjacent subtasks deriving from the same father task and between all subtasks com-
municating through a send-receive pair. An example of such a task decomposition is
illustrated in Figure 10.15.
In a pure asynchronous scheme, communicating tasks do not have to wait for each
other. The sender just deposits its message into a channel and continues its execution,
independently of the recipient condition. Similarly, assuming that at least a message
has been deposited into the channel, the receiver can directly access the message with-
out synchronizing with the sender.
Asynchronous communication schemes are more suitable for dynamic real-time sys-
tems. In fact, if no unbounded delays are introduced during tasks' communication,
timing constraints can easily be guaranteed without increasing the complexity of the
system (for example, overconstraining the task set with additional precedence rela-
Search WWH ::




Custom Search