Messages

GNO's Message IPC is borrowed from the XINU Operating System, designed by Douglas Comer. It is a simple way to send a datum (a message) to another process. Messages are 32-bit (4-byte) longwords.

The Message IPC is centered around two calls, procsend(2) and procreceive(2). The procsend call sends a message to a specified process ID. To access that message, a process must use procreceive. If no message is waiting for a process when it calls procreceive, the process will block until a message becomes available.

Since a process can only have one pending message, the Message IPC is useful mostly in applications where two or more cooperating processes only occasionally need to signal each other; for example, the init(8) program communicates with the initd daemon by sending messages. Various attributes are encoded in the 32-bit value sent to initd(8) to instruct it on how to change its state.

If a process doesn't want to indefinitely block waiting for a message, it can call procrecvtim(2). The procrecvtim call accepts a timeout parameter which indicates the maximum amount of time to wait for a message.



Feedback