为什么没有调查/选择类似机制的消息队列? [英] why is there no poll/select like mechanism for message queue?

查看:128
本文介绍了为什么没有调查/选择类似机制的消息队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像我们所能做的,民调/ epoll的/选择的FD,我们不能味精队列ID。我发现了一些非标准的方法,使msgqueue-ID于fd,但毕竟它是一个非标准。所以我的问题是,为什么Linux的爱好者,没有实现轮询/选择味精队列ID?这是否会导致严重的问题?

Like we can do, poll/epoll/select on an fd, we can not on msg queue id. I found some non standard methods to make msgqueue-id to fd, but afterall its a non standard. So my question is, Why linux geeks, not implemented poll/select on msg queue id ? Does that lead to serious issue ?

我需要实现这样的排序机制。我该怎么做?

I need to implement such sort of mechanism. How can I do that ?

推荐答案

从<一个href=\"http://www.kernel.org/doc/man-pages/online/pages/man7/mq_overview.7.html\"><$c$c>mq_overview手册页:

轮询消息队列描述符

在Linux中,消息队列描述符实际上是一个文件描述符,并且可以是
         使用select(2),民意调查(2),或epoll的监控(7)。这是不可移植的。

On Linux, a message queue descriptor is actually a file descriptor, and can be monitored using select(2), poll(2), or epoll(7). This is not portable.

所以你的可以的使用调查和朋友在消息队列 - 只要确保你使用的现代变种

So you can use poll and friends on message queues - just make sure you use the modern variant.

这篇关于为什么没有调查/选择类似机制的消息队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆