简体   繁体   English

POSIX消息队列 - 重启后是否仍然存在?

[英]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. 在linux上,编写了一个简单的程序来创建一个POSIX消息队列,并向它发送一个msg,在进程终止后,似乎msg仍然存在。

The questions are: 问题是:

  • Does the msg still there after reboot? 重启后msg仍然存在吗?
  • If it exists, then it's on disk, how did it guarantee the performance if it stores msg on disk instead of memory. 如果它存在,那么它在磁盘上,如果它将msg存储在磁盘而不是内存上,它如何保证性能。

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. 在Linux上,消息队列安装在虚拟文件系统上,文件的存在并不意味着任何内容都写入物理介质。 This implementation is specific to Linux and not required POSIX behaviour. 此实现特定于Linux,不需要POSIX行为。

The mq_overview man page describes the implementation. mq_overview手册页描述了实现。

不,它在重新启动后不存在,因为它驻留在虚拟文件系统上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM