38
K
A
DAK
Application Tasks
Figure 3.9-1 provides an example of the manner in which messages are allowed to queue
on a message exchange. The same message queuing technique is used when messages
are sent to a task's private mailboxes within its Task Control Block (TCB).
In the example, the following situation is assumed to exist at the message exchange on
which the destination task is waiting.
The message exchange has four message queues corresponding to the four priority levels
at which it can post messages. Level 0 is the highest priority; level 3 is the lowest
priority. The example shows that no messages are pending on levels 0 or 2. Three
messages, I, J and K, are pending on level 1. Two messages, L and M, are pending on
level 3. One message, X, is currently being serviced by the destination task.
The destination task has been interrupted and it is ready to resume execution. As a result
of the interrupt, task YY was allowed to execute because it was of higher priority than the
destination task. Task YY made a request to AMX to send a message to the message
exchange at message priority level 1. As a result of this request, AMX moved the
message parameters from task YY into a message envelope and added this envelope to
the bottom of the level 1 message queue associated with the message exchange. The
result is shown in Figure 3.9-1.
Message K
Message J
Message I
Message M
Message L
Message YY
0 2 31
MESSAGE EXCHANGE
Message X
being processed
Figure 3.9-1 Message Transmission