简体   繁体   English

POSIX消息队列的替代方法

[英]Alternative to POSIX message queues

I am using POSIX message queues in a non-root system. 我在非根系统中使用POSIX消息队列。 I am running into significant issues with unlinking and cleaning. 我在取消链接和清洁时遇到了重大问题。 I can't see opened message queues and then write a routine to clean them. 我看不到打开的消息队列,然后编写例程来清理它们。

I was wondering if one of the two are possible: 我想知道这两种方法之一是否可行:

  • Create POSIX mqueue locally, in $PWD or something 在$ PWD之类的本地创建POSIX mqueue
  • Get an alternative message queue library instead of the standard one from Linux. 从Linux获得替代的消息队列库,而不是标准的消息队列库。

One thing you can try is to see whether you can go by using a unix domain datagram sockets instead of posix message queues, in particular SOC_SEQPACKET variety of those: 您可以尝试做的一件事是查看是否可以通过使用uniix域​​数据报套接字而不是posix消息队列来访问,尤其是那些SOC_SEQPACKET队列:

http://man7.org/linux/man-pages/man7/unix.7.html http://man7.org/linux/man-pages/man7/unix.7.html

If this is not enough, there are plenty of message queue abstraction libraries out there, such as a popular ZeroMQ: http://zeromq.org/ 如果这还不够的话,那里有很多消息队列抽象库,例如流行的ZeroMQ:http: //zeromq.org/

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

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