Re: Signals and threads
- From: Bernd Strieder <strieder@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Nov 2006 13:57:23 +0100
Hello,
shibu-kundara wrote:
Hi.
Thanks for the response let me clear the question,
I have two thread registered two different signal handler
SigHndlrFuncA,SigHndlrFuncB
Both is registerd with SIGUSR1.
When i send SIGUSR1 signal to threadA why SigHndlrFuncB is getting
called instead of SigHndlrFuncA???
Because there is only one handler for all threads together possible. The
last time setting the handler will supersede the other times. Using
signals with threads is supposed to be done with directing the signals
to one specific thread per signal, via the masks. A signal is
implemented to be sent to a process, the actual thread receiving it is
a priori undefined. There is only one handler for all threads.
If you want to change this, you have to change the parts of the kernel
and the system libraries working together on this. There are signals
that don't make any sense to be reacted to by a single thread, so there
will be a lot of problems with the changes.
There are potentially better ways to communicate between threads than
signals, requiring fewer system calls, i.e. less overhead. So there has
never been a real need to extend signals to be used with threads more
easily.
Regards,
Bernd Strieder
.
- References:
- Signals and threads
- From: shibu-kundara
- Re: Signals and threads
- From: loic-dev
- Re: Signals and threads
- From: shibu-kundara
- Re: Signals and threads
- From: "Nils O. Selåsdal"
- Re: Signals and threads
- From: shibu-kundara
- Signals and threads
- Prev by Date: Re: Signals and threads
- Next by Date: Re: Signals and threads
- Previous by thread: Re: Signals and threads
- Next by thread: Re: Signals and threads
- Index(es):
Relevant Pages
|