From: Philippe Gerum <rpm@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Jan Kiszka <jan.kiszka@domain.hid>,
Xenomai core <Xenomai-core@domain.hid>
Subject: Re: [Xenomai-core] [PATCH 1/1] Use SIGWINCH to trigger priority change in user-space.
Date: Sun, 19 Oct 2008 18:37:27 +0200 [thread overview]
Message-ID: <48FB6247.5010203@domain.hid> (raw)
In-Reply-To: <48FB5F1C.401@domain.hid>
Gilles Chanteperdrix wrote:
> Philippe Gerum wrote:
>> Gilles Chanteperdrix wrote:
>>> Jan Kiszka wrote:
>>>> Gilles Chanteperdrix wrote:
>>>>> Jan Kiszka wrote:
>>>>>> I wonder if we shouldn't switch the signal hooking strategy: So far we
>>>>>> install the handler at shadow thread creation time, saving a potentially
>>>>>> installed handler of the application for redirection of
>>>>>> Xenomai-unrelated events. But that only works if the application
>>>>>> installed the handler before it creates the first shadow thread, right?
>>>>>> If the app decides to install/change the SIGWINCH handler later on
>>>>>> (without taking care of our handler), we will loose.
>>>>>>
>>>>>> Suggestion: As this is fragile and cannot be solved transparently, lets
>>>>>> document this signal requirement of Xenomai, e.g. in all task/thread
>>>>>> creation functions of the skins. Tell the user that Xenomai will install
>>>>>> a custom SIGWINCH handler and that, if the app wants to override it, it
>>>>>> has to make sure to _first_ call into a Xenomai-provided handler and
>>>>>> check if that one wants to handle the event. I'm thinking of something
>>>>>> like int xeno_sigwinch_handler(int sig, siginfo_t *si, void *ctxt),
>>>>>> where the return code is non-zero in case the signal was processed.
>>>>>>
>>>>>> With this policy in place, we can switch the signal handler installation
>>>>>> above to __attribute__ ((construtor)) and save us all the changes
>>>>>> regarding sigshadow_install below.
>>>>> You mean to push the burden of identifying the signal source and calling
>>>>> the proper handler on the user. With the current approach we take care
>>>>> of that burden, I think it is better. But I agree that this should be
>>>>> documented somewhere.
>>>> Nope, the burden will still be Xenomai's, encoded in
>>>> xeno_sigwinch_handler. The app will only have to check for its return code.
>>> Actually, I have no real preference. Philippe, since you designed the
>>> original code, could you tell us what you had in mind?
>>>
>> My reasoning at that time was that the application folks would not want or even
>> be able to change the signal handling code to insert anything Xenomai might
>> need, hence the override-then-route-unhandled approach. A typical configuration
>> I thought of was GUI-based apps, that would include RT code as well. In that
>> case, I don't think that most of us would want to be dragged into rebuilding
>> kde/gtk libs, for the sole purpose of routing unhandled SIGSHADOW signals.
>>
>> At the same time, I agree with Jan that we should not prevent people who prefer
>> hacking their own software components to install that routing in their handler,
>> instead of fiddling with the order in which they do the application init chores.
>>
>> Well, what about merging the solutions: trap the signal from the library
>> constructor by default for people relying on #1, AND document the shadow signal
>> handler for people who can do #2?
>
> For me, merging the two, would mean keep sigshadow_install called upon
> thread creation, but export xeno_sigwinch_handler to be callable from
> user signals.
>
> This way, if people install their signal handler before the first thread
> creation, they have nothing to worry about. If they install their signal
> handler at a later time, they have to take care of calling
> xeno_sigwinch_handler and look at its return value.
>
Yes, hooking the SIGSHADOW within the lib ctor() would eventually be a bad idea.
--
Philippe.
next prev parent reply other threads:[~2008-10-19 16:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-18 14:22 [Xenomai-core] [PATCH 1/1] Use SIGWINCH to trigger priority change in user-space Gilles Chanteperdrix
2008-10-18 14:35 ` Gilles Chanteperdrix
2008-10-18 17:09 ` Philippe Gerum
2008-10-19 15:21 ` Gilles Chanteperdrix
2008-10-19 11:10 ` Jan Kiszka
2008-10-19 11:19 ` Gilles Chanteperdrix
2008-10-19 11:22 ` Jan Kiszka
2008-10-19 11:28 ` Gilles Chanteperdrix
2008-10-19 16:09 ` Philippe Gerum
2008-10-19 16:14 ` Philippe Gerum
2008-10-19 16:16 ` Gilles Chanteperdrix
2008-10-19 16:23 ` Gilles Chanteperdrix
2008-10-19 16:37 ` Philippe Gerum [this message]
2008-10-20 8:25 ` Gilles Chanteperdrix
2008-10-20 8:40 ` Jan Kiszka
2008-10-20 18:57 ` Gilles Chanteperdrix
2008-10-20 19:00 ` Jan Kiszka
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=48FB6247.5010203@domain.hid \
--to=rpm@xenomai.org \
--cc=Xenomai-core@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=jan.kiszka@domain.hid \
/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.