消息队列 读和写两个进程不需要同时出现 (参考命名管道mkfifo)
Linux有POSIX和System V 两种消息队列
- POSIX消息队列 打开消息队列mq_open() 成功返回一个消息队列描述符
#include <fcntl.h>
#include <sys/stat.h>
#include <mqueue.h>
mqd_t mq_open(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
-
name: 由“/”开头、空字符"\0"结尾、中间最

本文详细介绍了Linux中的POSIX和SystemV消息队列,包括消息队列的创建、mq_open函数用法、消息发送与接收、mq_notify的异步通知,以及mq_attr结构和相关API的使用。

2293

被折叠的 条评论
为什么被折叠?



