Hardware Reference
In-Depth Information
subtask
1-a
τ
τ
subtask
2-a
1
2
τ
τ
send
A
send(mes, A)
receive(mes, A)
receive
subtask
1-b
subtask
τ
τ
2-b
(a)
(b)
Figure 10.15
Decomposition of communicating tasks (a) into subtasks with precedence
constraints (b).
Mailbox
Producer
Consumer
Figure 10.16
The mailbox scheme.
tions). Remember that having simple online guarantee tests (that is, with polynomial
time complexity) is crucial for dynamic systems.
In most commercial real-time operating systems, the asynchronous communication
scheme is implemented through a
mailbox
mechanism, illustrated in Figure 10.16. A
mailbox is a shared memory buffer capable of containing a fixed number of messages
that are typically kept in a FIFO queue. The maximum number of messages that at
any instant can be held in a mailbox represents its
capacity
.
Two basic operations are provided on a mailbox - namely,
send
and
receive
.A
send(MX, mes)
operation causes the message
mes
to be inserted in the queue of mail-
box
MX
. If at least a message is contained on mailbox
MX
,a
receive(MX, mes)
operation extracts the first message from its queue. Note that, if the kernel provides
the necessary support, more than two tasks can share a mailbox, and channels with
multiple senders and/or multiple receivers can be realized. As long as it is guaran-
teed that a mailbox is never empty and never full, sender(s) and receiver(s) are never
blocked.
Search WWH ::
Custom Search