http://www.perlmonks.org?node_id=815520


in reply to $SIG{ALRM} and windows vista?

You're being bitten by Safe Signals. And the problem is not sourced in, nor confined to Windows.

UPDATE: ikegami's right!

I would have sworn that at one point after alarm was implemented on Windows and before Safe Signals were introduced, that this particular scenario worked. But I must be mixing up my memories, because it now doesn't regardless of the setting of PERL_SIGNALS=unsafe.

Sorry for the bum steer.


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.

Replies are listed 'Best First'.
Re^2: $SIG{ALRM} and windows vista?
by ikegami (Patriarch) on Jan 04, 2010 at 06:37 UTC

    Not true.

    $ perl 815492.pl Enter your password: You timed out.

    Signals for which there is a handler will interrupt I/O operations (at the OS level) even under safe signals. readline returns (with errno = EINTR) as soon as the signal is received, allowing the signal handler to be called within milliseconds even under safe signals.

      Not on my Vista system.


      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.

        It sounds like you're saying that signals don't interrupt I/O on Windows, but you know that only thing that Windows has that is similar to signals are Ctrl-C and Ctrl-Break. Are you saying they don't interrupt I/O? I haven't tested how they work.

        Update: Clarified.

Re^2: $SIG{ALRM} and windows vista?
by ikegami (Patriarch) on Jan 04, 2010 at 07:37 UTC

    I would have sworn that at one point after alarm was implemented on Windows and before Safe Signals were introduced

    alarm was first implemented on Windows in 5.8.0. Safe Signals were also introduced then.

    Using 5.8.0 with PERL_SIGNALS=unsafe, alarm didn't interrupt <STDIN>.