Introducing MQs and the pub/sub mechanism
We’re glad to be back on the IPC topic. The last time we discussed it was in Chapter 3, where we explained pipes and used some code examples. You learned about the basic mechanism of exchanging data between processes, but as you remember, there are some blocking points. As with any programming instrument, pipes have particular usage – they are fast, and they can help you send and receive data from both related (forked) processes (through anonymous pipes) and unrelated processes (through named pipes).
In a similar fashion, we could use MQs to transfer data, which are available to related and unrelated processes, too. They provide the ability to send a single message to multiple receiving processes. But as you saw, pipes are primitive in the sense of sending and receiving binary data as is, while MQs bring the notion of a message to the table. The policy of the transfer is still configured in the calling process – queue...