Skip to content
Advertisement

POSIX message queue – Does it still exists after reboot?

On linux, wrote a simple program to create a POSIX message queue, and send a msg to it, after the process terminated, it seems the msg is still there.

The questions are:

  • Does the msg still there after reboot?
  • If it exists, then it’s on disk, how did it guarantee the performance if it stores msg on disk instead of memory.

Advertisement

Answer

On Linux, message queues are mounted on a virtual file system, and the presence of a file does not imply that anything is written to physical media. This implementation is specific to Linux and not required POSIX behaviour.

The mq_overview man page describes the implementation.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement