Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Thread specific signal handling

1 view
Skip to first unread message
Message has been deleted

Rainer Weikusat

unread,
Oct 1, 2008, 1:09:53 PM10/1/08
to
kenkahn <ken...@optonline.net> writes:
> Is there any way to set up a signal handler for specific threads,
> instead of for the whole process using sigaction()?

Not using any of the standardized threading interfaces. There are two
categories of signal defined:

- so-called asychronous signals targetted at the process (eg
SIGCHLD or SIGALRM): These are supposed to be handled by an
arbitrary thread not blocking them (presumably, one that
isn't already busy doing something else)

- synchronous signals (eg SIGSEGV), which are supposed to be
sent to the thread which caused them

It is possible to send signals to specific threads using pthread_kill,
but not to defined per-thread handlers for any signals (eg that one
thread does something different upon reception of a SIGUSR1 than
another).

0 new messages