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

前端 未结 5 1959
感情败类
感情败类 2021-01-14 01:19

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 q

5条回答
  •  遥遥无期
    2021-01-14 02:10

    As Mat points out, POSIX MQs can be used with select/poll in Linux. Beyond that, mq_notify() provides you with the options to receive a signal or spawn a new thread when an empty MQ receives a message. This is another means to avoid blocking or polling.

提交回复
热议问题