Hello Monks

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...


In reply to Signaling in forked threads by ajeet@perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.