All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Matthias Schneider <ma30002000@yahoo.de>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] EINTR in notifier.c (mercury)
Date: Mon, 31 Mar 2014 13:19:10 +0200	[thread overview]
Message-ID: <53394F2E.5070801@xenomai.org> (raw)
In-Reply-To: <1396262085.387.YahooMailNeo@web171601.mail.ir2.yahoo.com>

On 03/31/2014 12:34 PM, Matthias Schneider wrote:
> Hi all,
>
>
> still working on thread suspension in mercury, I noticed that some
>
> threadobj_suspend() and threadobj_resume() calls seemed not to have the desired
>
> effect. Analyzing the issue, I found out that sometimes the read operations on
> the pipe in notifier_wait() seem to return with EINTR, especially in
> heavily loaded systems. Restarting the read system call in that case made
> thread suspension a lot more reliable in my case.
>
> I have attached a patch adding loops to deal with the EINTR situation in all
>
> read and write operations of notifier.c.
>

Agreed, we are reading from a deemed slow device. However, the patch is 
wrong in testing the first loop condition (notifier_sighandler). In 
addition, we don't need two nested loops, a single one would suffice 
with a proper test condition.

Nitpicking: please move all variable declarators to the outer local 
declaration block, and avoid compound braces for single-statement blocks.

-- 
Philippe.


  reply	other threads:[~2014-03-31 11:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 10:34 [Xenomai] EINTR in notifier.c (mercury) Matthias Schneider
2014-03-31 11:19 ` Philippe Gerum [this message]
2014-03-31 11:27 ` Gilles Chanteperdrix
2014-03-31 13:18   ` Philippe Gerum
2014-03-31 17:43     ` Matthias Schneider
2014-03-31 17:50     ` Gilles Chanteperdrix
2014-04-06 11:11       ` Matthias Schneider
2014-04-06 15:04         ` Philippe Gerum
2014-04-06 15:09           ` Gilles Chanteperdrix
2014-04-07  9:01             ` Philippe Gerum
2014-04-07 16:49           ` Matthias Schneider
2014-04-08  7:22             ` Philippe Gerum
2014-04-11 14:59             ` Philippe Gerum
2014-04-11 15:07               ` Philippe Gerum
2014-04-11 16:44                 ` Matthias Schneider
2014-04-11 17:02                   ` Philippe Gerum

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=53394F2E.5070801@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=ma30002000@yahoo.de \
    --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.