![]() |
![]() |
![]() |
Reply with a message
#include <sys/neutrino.h> int MsgReply( int rcvid, int status, const void* msg, int size ); int MsgReply_r( int rcvid, int status, const void* msg, int size );
libc
The MsgReply() and MsgReply_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These kernel calls reply with a message to the thread identified by rcvid. The rcvid is returned from MsgReceive*() when you receive the message. The thread being replied to must be in the REPLY-blocked state. Any thread in the receiving process is free to reply to the message, however, it may be replied to only once for each receive.
The MsgSend*() in the rcvid thread unblocks with a return value of status.
The data is taken from the buffer of size bytes pointed to by msg. The size of the message is specified in size.
The number of bytes transferred is the minimum of that specified by both the replier and the sender. The reply data won't be allowed to overflow the reply buffer area provided by the sender.
The data transfer occurs immediately and the replying task doesn't block. There's no need to reply to received messages in any particular order, however, you must eventually reply to each message to allow the sending thread(s) to continue execution.
None. In the network case, lower priority threads may run.
The MsgReply() function has increased latency when it's used to communicate across a network -- the server is now writing data to its local npm-qnet, which may need to communicate with the client's npm-qnet to actually transfer the data.
The only difference between the MsgReply() and MsgReply_r() functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
MsgReceive(), MsgReceivev(), MsgReplyv(), MsgSend(), MsgSendv(), MsgWrite(), MsgWritev()
![]() |
![]() |
![]() |