Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.
like image 717
user218867 Avatar asked Jan 07 '23 23:01

user218867


1 Answers

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.

like image 197
Clifford Avatar answered Jan 16 '23 21:01

Clifford