Download 8051 RTOS

Transcript
Interprocess Communication
Unqueued Receive Message
On the receiving side an unqueued message is not consumed by reading; it returns the last received
value each time it is read.
If in the example the message M is unqueued for TaskB and ISRA, both will read from the same buffer
on the receive side when using ReceiveMessage(). The buffer is overwritten for both TaskB and
ISRA only when TaskA sends new data (ReceiveMessage() keeps reading the same value
meanwhile). More than one receiver can read from the same unqueued buffer.
Queued Receive Message
On the receiving side a queued message can only be read once (the read operation removes the
oldest message from the queue).
If in the example the message M is queued for TaskC, there will be a dedicated receive queue buffering
the messages for TaskC (every queued receiver has its own receive queue). The queue size for a
particular message is specified per receiver. If a receive queue is full and a new message arrives, the
message is lost for this receiver. Obviously to prevent this situation, the average processing time of a
message should be shorter than the average message interarrival time.
Send Message Object
The send message object is the internal container where the data is stored on the sending side, every
time that a sender of the message attempts to send the message.
In the example there will be only one send message object for TaskA.
Receive Message Object
The receive message object is the internal container where the data is stored on the receiving side.
The message object is available for an arbitrary number of receivers if the message is unqueued, or for
only one receiver when queued.
In the example there will be two receive message objects, one for TaskB and ISRA (which size is the
size of the transmitted data) and a second one for TaskC (which size is the size of the transmitted data
times the size of the queue).
Symbolic Name
A symbolic name is the application identification for a message object (send or receive).
A symbolic name identifies either a send message object or a received message object for an
unqueued receive message or a received message object for a queued receive message. In fact, the
symbolic name becomes an alias for the container.
10-3