The Message Queue

The UNIX message queue implements a priority-based queue of messages. The message is simply a short block of memory holding an application-defined message. When a message is queued, it is stored within kernel memory so that it can be later retrieved by another process. Figure 22.1 illustrates how messages are queued, stored, and retrieved.

Figure 22.1. The Message Queue Store within the kernel.

The figure shows three processes queuing messages and one process receiving messages. Message queues in general, however, can by queued by many processes and received by many processes.

Every queued message has a message priority. UNIX ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.