Yes, your understanding is correct. You cannot do this reliably with POSIX message queues. If you want to reliably transmit the same message to different threads / processes, you must use a different queue for each reader.
This can be done if you switch to SYSV message queues. Msgsnd () and msgrcv () can handle the message type field of a message in some consistent protocol. For example, the writing process will make the message type of the PID message of the reading process; and the reading process will request to read only messages of this type of message. Note that this still requires the writer to write a message for each reading process.
source share