ajeet@perl has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a program which deals with threads, as because i dont have perl interprter which supports thread natively, I used forks.pm module from CPAN.
Now, When i run my program, i get two threads running for my program. But when i remove "use forks", it displays onle one thread. So, what i guess is that forks module create a new thread which take care of all the thread related activities, cleanup etc.
Problem is that, if i send a signal 'SIGUSR1' or 'SIGUSR2' to my program, it is also delivered to the thread, which is created by forks module, which in result terminate my program. Now, what my requirement is, when i send any signal to my program, then it should be catched by all other threads except that forks module thread.
Is there any way through which i can write a handler, which does nothing and override the handler of thread created by perl forks module. My ultimate goal is just to deliver signals to all threads except the thread of forks module...
Thanks in Advance...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Signaling in threads
by BrowserUk (Patriarch) on Apr 07, 2010 at 10:31 UTC | |
by ajeet@perl (Acolyte) on Apr 07, 2010 at 11:22 UTC | |
by BrowserUk (Patriarch) on Apr 07, 2010 at 11:37 UTC | |
|
Re: Signaling in threads
by cdarke (Prior) on Apr 07, 2010 at 09:52 UTC | |
by almut (Canon) on Apr 07, 2010 at 10:05 UTC |