Semantics of the Message Passing Functions

Message Passing is synchronous: the sender sends a message using REXIS_MessageSend() and the sender task is blocked until the receiver receives the message and replies to the message. A receiver uses REXIS_MessageReceive() to receive a message. If a receiver calls REXIS_MessageReceive() and there is no pending message, the receiver waits until a message is sent.

Once received, the receiver continues execution and eventually uses REXIS_MessageReply() to reply to the original sender. Once a reply reaches the original sender, the sender becomes unblocked and its execution continues.

Error Reply

When the receiver sends a reply using REXIS_MessageReply, the length of the reply buffer (reqlen above, which must be zero or greater) is sent to the message sender as the return value of the REXIS_MessageSend function. In the case that the message receiver wishes to send an error code as the return value of the REXIS_MessageSend function, it should use the function REXIS_MessageError. The error code must be a negative value. If not, -1 will be used instead.

Message Passing Sequence of Events

 

1.    Sender sends a message using REXIS_MessageSend and becomes blocked

2.    Receiver receives the message using REXIS_MessageReceive and performs processing

3.    Receiver sends a reply message to the original sender using REXIS_MessageReply or REXIS_MessageError

4.    Original sender resumes execution