All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Xenomai 2.0.1 - Posix Skin - implementing a periodic thread
Date: Tue, 13 Dec 2005 21:27:10 +0100	[thread overview]
Message-ID: <17311.11934.369273.220410@domain.hid> (raw)
In-Reply-To: <439F0B78.2000002@domain.hid>

Paolo Gai wrote:
 > Dear all,
 > 
 > here is another small demo... this time of a periodic thread in POSIX.
 > 
 > It works under Xenomai, but it fails under Posix Real-Time.
 > 
 > The reason of the failure is the SIGUSR1 not being blocked by the main 
 > thread. If in main() the comments below the note "// REMOVE THE COMMENTS 
 > BELOW" are removed, then the signal is masked also in the main(), and as 
 > a result the POSIX version works.
 > 
 > The question I have is if the behavior in Xenomai (that is, not failing 
 > like the POSIX counterpart) is correct or not...

The answer is in section 2.4.2 of the standard, delivery of real-time
signals.

http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_02

real-time signals are marked pending to the process, not a particular
thread. So, Linux implementation is correct, Xenomai is incorrect.

When creating a timer with timer_create, Xenomai assume that signals
will be delivered to the thread which created the thread.

Linux supports an extension which allows timer notifications to be
delivered to a particular thread; set the sigev_notify member of the
sigevent structure to 
SIGEV_SIGNAL | SIGEV_THREAD_ID
and set the member _sigev_un._tid to the thread ID of the target thread.

-- 


					    Gilles Chanteperdrix.


      parent reply	other threads:[~2005-12-13 20:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 17:57 [Xenomai-help] Xenomai 2.0.1 - Posix Skin - implementing a periodic thread Paolo Gai
2005-12-13 18:22 ` Jan Kiszka
2005-12-13 20:27 ` Gilles Chanteperdrix [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=17311.11934.369273.220410@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --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.