in reply to Re^9: Exiting a script with an 'infinitely looping' thread
in thread Exiting a script with an 'infinitely looping' thread

I know it works with unsafe signals. Never said it didn't. It's a workaround, but not the cause. The problem is that sleep is broken in Windows. It's not interrupted by signals as the documentation says it should be.

Replies are listed 'Best First'.
Re^11: Exiting a script with an 'infinitely looping' thread
by BrowserUk (Patriarch) on Nov 24, 2008 at 19:11 UTC
    I know it works with unsafe signals.

    sleep was interuptable before safe signals were introduced. sleep is interuptable if safe signals are disabled.

    Viz: the implementation of safe signals is the root cause of the problem (even if the fix is to modify the implementation of sleep), and my statement that: "Due to Perl "safe signals", sleep is an uninteruptable opcode." is correct.

    And all your noise in this thread amounts to nothing more than an addendum of "only under windows", which is redundant, as I was replying to the OP who must be using windows otherwise he wouldn't have encountered the problem.


    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.

      sleep is interuptable if safe signals are disabled.

      It's suppose to be, but it isn't on Windows. The following won't to print 'OK' like it the documentation says it does. With or without safe signals.

      >perl -wle"$SIG{INT}=sub{}; sleep; print 'OK'"

      The implementation of safe signals makes sleep's uninterruptibility a bigger issue than it was before, but the bug already existed.

      OP who must be using windows otherwise he wouldn't have encountered the problem.

      Every problem he's had occurs on non-Windows as well. And he said he's using Red Hat Enterprise Linux.