All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: "Landau, Bracha" <BLandau@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] xenomai user app working very slowly - "select" issue
Date: Thu, 21 Jan 2010 18:11:27 +0100	[thread overview]
Message-ID: <1264093887.2350.98.camel@domain.hid> (raw)
In-Reply-To: <065A7D06F7D4E546A18E80E08D066E18146A3CE4D0@domain.hid>

On Thu, 2010-01-21 at 18:45 +0200, Landau, Bracha wrote:
> Each thread represents a different physical resource. The message queue feeding into the thread contains messages that may be serviced by any one of the resources.
> 
> 1) Why would there be spurious wakeups?
> 2) I did the mq_open as nonblocking.
> 3) It did "work", but all the messages were serviced by a sing

What you might look for, is the round-robin scheduling policy to divide
your timeline in multiple slots your different threads could run in. The
only upside of this would be to prevent any given thread to keep the CPU
busy for too long for processing a single message, at the expense of not
always processing the messages in strict FIFO ordering.

But if you want to stick to the FIFO policy to implement a thread pool,
for polling a single fd with threads that rarely block to handle a
message, I don't understand your design more than Gilles does, I'm
afraid.

> 
> 
> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Thursday, January 21, 2010 6:41 PM
> To: Landau, Bracha
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] xenomai user app working very slowly - "select" issue
> 
> Gilles Chanteperdrix wrote:
> > Landau, Bracha wrote:
> >> You say "There is not much point using several thread to select on the same file descriptor. The point of select is rather the reverse: being able to wait for several file descriptors with only one thread"
> >> I rely on this in my design. Are you saying that Xenomai does not support having a few threads wait on the same file descriptor?
> >
> > No, I say this is braindamaged design, because you will get lots of
> > spurious wakeups. But it should work.
> 
> And to get it working, you have to be sure to put all the file
> descriptors in non-blocking mode, and be ready for the read/recv
> operation to fail with errno set to -EWOULDBLOCK, because if two threads
> wake up because select signaled that the same file descriptor is ready,
> one thread will win the race, and read will succeed, the other will not.
> If the file descriptor is not in non-blocking mode, the second read will
> block its caller.
> 
> --
>                                             Gilles.
> 
> This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@domain.hid and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
> To protect the environment please do not print this e-mail unless necessary.
> 
> An NDS Group Limited company. www.nds.com
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help


-- 
Philippe.




      parent reply	other threads:[~2010-01-21 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 17:36 [Xenomai-help] xenomai user app working very slowly Landau, Bracha
2010-01-11 17:53 ` Gilles Chanteperdrix
     [not found] ` <4B4B64AF.3040704@domain.hid>
2010-01-12 11:32   ` Landau, Bracha
2010-01-12 11:36     ` Gilles Chanteperdrix
2010-01-14 13:53       ` [Xenomai-help] xenomai user app working very slowly - "select" issue Landau, Bracha
2010-01-14 14:49         ` Gilles Chanteperdrix
2010-01-21 16:29           ` Landau, Bracha
2010-01-21 16:32             ` Gilles Chanteperdrix
2010-01-21 16:41               ` Gilles Chanteperdrix
2010-01-21 16:45                 ` Landau, Bracha
2010-01-21 16:49                   ` Gilles Chanteperdrix
2010-01-21 17:11                   ` Philippe Gerum [this message]

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=1264093887.2350.98.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=BLandau@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.