in reply to Re^5: Perl5.8.4 , threads - Killing the "async" kid
in thread Perl5.8.4 , threads - Killing the "async" kid

Hi

I can confirm that in Perl 5.8.4, threads v1.03 , each thread gets its own signal handler. This also explains my duplicate lines in the log file mentioned earlier in this topic.

  • Comment on Re^6: Perl5.8.4 , threads - Killing the "async" kid

Replies are listed 'Best First'.
Re^7: Perl5.8.4 , threads - Killing the "async" kid
by BrowserUk (Patriarch) on Oct 14, 2010 at 15:18 UTC
    This also explains my duplicate lines in the log file

    In a word; upgrade. At least threads & threads::shared. Preferably Perl also.

    But these things are often out of our control :(

    At a pinch; assuming that the quote means that the signal handler is being called separately on all the threads, add a check to only process the signal if you are the main thread. (Untested.):

    sub handler { yield, return unless threads->tid == 0; ## Handle the signal }

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.