* [Xenomai-help] Signal mask inheritance
[not found] <8218410.41297420786765.JavaMail.SYSTEM@pc-msalvini>
@ 2011-02-11 10:50 ` Mauro Salvini
2011-02-11 11:00 ` Mauro Salvini
2011-02-11 11:04 ` Gilles Chanteperdrix
0 siblings, 2 replies; 3+ messages in thread
From: Mauro Salvini @ 2011-02-11 10:50 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 673 bytes --]
Hi to all,
I would build an application where only one of real-time tasks executes a custom signal handler to respond to a set of signals (ex SIGINT, SIGTERM).
Xenomai tasks are also POSIX threads, so I think that at creation they inherits all signal masks and handlers from parent thread.
So, what I can do in my app is reset signal mask to block all signals when new task starts.
Can I block all signals or there are some signals (eg SIGWINCH) needed by Xenomai for inter-task communication?
By the way, is there a method in Xenomai to initialize all RT_TASK structure fields without use field names (eg PTHREAD_MUTEX_INITIALIZER )?
I use this simple define:
[-- Attachment #2: Type: text/html, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-help] Signal mask inheritance
2011-02-11 10:50 ` [Xenomai-help] Signal mask inheritance Mauro Salvini
@ 2011-02-11 11:00 ` Mauro Salvini
2011-02-11 11:04 ` Gilles Chanteperdrix
1 sibling, 0 replies; 3+ messages in thread
From: Mauro Salvini @ 2011-02-11 11:00 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
I apologize for latter message, my client decides to automatically send it before completion...
I rewrite it here:
Hi to all,
I would build an application where only one of real-time tasks executes a custom signal handler to respond to a set of signals (ex SIGINT, SIGTERM).
Xenomai tasks are also POSIX threads, so I think that at creation they inherits all signal masks and handlers from parent thread.
So, what I can do in my app is reset signal mask to block all signals when new task starts.
Can I block all signals or there are some signals (eg SIGWINCH) needed by Xenomai for inter-task communication?
By the way, is there a method in Xenomai to initialize all RT_TASK structure fields without use field names (eg PTHREAD_MUTEX_INITIALIZER )?
I use this simple define:
#define RT_TASK_RESET(task) task.opaque=0 , task.opaque2=0
but it works only for kernel tasks (in include/native/task.h RT_TASK structure isn't the same for kernel/non kernel tasks).
I think that a struct initializer into library could be a next feature.
Thank you,regards.
[-- Attachment #2: Type: text/html, Size: 1417 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-help] Signal mask inheritance
2011-02-11 10:50 ` [Xenomai-help] Signal mask inheritance Mauro Salvini
2011-02-11 11:00 ` Mauro Salvini
@ 2011-02-11 11:04 ` Gilles Chanteperdrix
1 sibling, 0 replies; 3+ messages in thread
From: Gilles Chanteperdrix @ 2011-02-11 11:04 UTC (permalink / raw)
To: Mauro Salvini; +Cc: xenomai
Mauro Salvini wrote:
> Hi to all,
>
> I would build an application where only one of real-time tasks
> executes a custom signal handler to respond to a set of signals (ex
> SIGINT, SIGTERM). Xenomai tasks are also POSIX threads, so I think
> that at creation they inherits all signal masks and handlers from
> parent thread.
Handlers are per-process, not per-thread.
> So, what I can do in my app is reset signal mask to
> block all signals when new task starts.
Why do this? Why not only mask the signals you want to handle in the
separate thread?
And yes, you must let Xenomai thread handle SIGWINCH
> By the way, is there a method in Xenomai to initialize all RT_TASK
> structure fields without use field names (eg
> PTHREAD_MUTEX_INITIALIZER )? I use this simple define:
Well, as you found out, one of the members of the RT_TASK structure is
the pthread_t identifier of the corresponding thread, so, how do you
figure it would be possible to initialize the RT_TASK in advance before
the thread is even created?
And by the way, POSIX has PTHREAD_MUTEX_INITIALIZER, not
PTHREAD_INITIALIZER. So, you are comparing things which are not really
comparable.
Listen, we do have limited ressources to answer your questions, so
please take time to read some documentation, and think a bit before
asking questions.
--
Gilles.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-11 11:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <8218410.41297420786765.JavaMail.SYSTEM@pc-msalvini>
2011-02-11 10:50 ` [Xenomai-help] Signal mask inheritance Mauro Salvini
2011-02-11 11:00 ` Mauro Salvini
2011-02-11 11:04 ` Gilles Chanteperdrix
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.