[730] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: About signal handler per pthread

daemon@ATHENA.MIT.EDU (Nick Godbey)
Tue Oct 21 14:43:07 1997

Date: Tue, 21 Oct 1997 13:08:37 -0500
From: Nick Godbey <Nick.Godbey@es.atl.sita.int>
To: Zhenhai Duan <duan@cs.umn.edu>
Cc: pthreads@MIT.EDU, proven@MIT.EDU

Zhenhai Duan wrote:

> Hello,
>
>         I am a new user of the pthread(POSIX thread), and I do not
>         know that how let each thread handle signal seperately, Maybe
>         the following example can make it more clearly.
>
>         A, B ,and C are three pthread of one process,
>         A send SIGUSR1 to B, and C,
>
>         In B:
>                 BHandler() is function to handle SIGUSR1;
>                 sigaction(....);
>         In C:
>                 CHandler() is function to handle SIGUSR1;
>                 sigaction(...);
>
>         in C:
>                 pthread_kill(Bpthread, SIGUSR1);
>                 pthread_kill(Cpthread, SIGUSR1);
>
>         But it seems that only B or C can handle SIGUSR1.
>
>         Please give some information. Thank you!
>

handlers are process level. The last handler set for SIGUSR1  will be
called in
each case. However, the desired thread is the one interupted.

-nick



home help back first fref pref prev next nref lref last post