in reply to Re^10: 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.

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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^11: Exiting a script with an 'infinitely looping' thread

Replies are listed 'Best First'.
Re^12: Exiting a script with an 'infinitely looping' thread
by ikegami (Patriarch) on Nov 24, 2008 at 22:38 UTC

    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.