Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why is there no poll/select like mechanism for message queue?

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 ?

like image 520
JohnG Avatar asked Nov 29 '22 17:11

JohnG


1 Answers

From the mq_overview man page:

Polling message queue descriptors

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.

like image 112
Mat Avatar answered Dec 05 '22 10:12

Mat