linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Romain Geissler <romain.geissler@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: mq_timedreceive on multiple queues
Date: Mon, 15 Apr 2013 09:48:05 +0200	[thread overview]
Message-ID: <CAF+LTefWbDyLPukDFei7o9LdOjoHrF6=ud5Oyk=P5epPgdz_rg@mail.gmail.com> (raw)

Hi,

I am currently facing an issue when reading in a set of several posix
queues (let's say 2 different mqueues) from several processes. I
currently use epoll_wait to wait for an incoming message on either
queue on all listening processes, then mq_timedreceive to retrieve it
from the queue.

This is an issue when the number of reader process grows, as if I send
only one message on a queue, all processes are awaken when epoll_wait
returns, and all processes try to fetch the message. I would like to
fix this and wake up only one process when listening to several
queues, removing the useless user/kernel space switchs for the other
listening processes.

Is there any way to run a mq_receive/mq_timedreceive on several
queues, that would wake up only one process? Something more or less
like epoll, but that also fetches a message from the readable queues
before returning.

Thanks,
Romain

                 reply	other threads:[~2013-04-15  7:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF+LTefWbDyLPukDFei7o9LdOjoHrF6=ud5Oyk=P5epPgdz_rg@mail.gmail.com' \
    --to=romain.geissler@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).