in reply to Re^13: Print inside SIGNALS (updated)
in thread Print inside SIGNALS
Hi haukex,
I have run your program and I keep getting 2 as a result too (on Linux)
I've tried to create something that also works on Windows:
alarm 2; $SIG{ALRM} = \&Finish; print "Sleep 5\n" ; sleep 5 ; sub Finish { print "Sleep 5 sig\n" ; sleep 5 ; print "Timeout reached\ +n"; } __END__ Sleep 5 Sleep 5 sig Timeout reached
You have to actually run this to see that it runs for 10 seconds. This shows that the first sleep is actually suspended and the sleep inside the Finish routine is executed, once if finishes it continues to execute the other previous sleep.
Yesterday I was testing on Linux and Windows back and forth and I think I got confused somewhere. It is clear to me that Windows behaves very different if it comes down to signals. I know that the OP asked for Linux assistance as well, so my response right now may be off topic I know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^15: Print inside SIGNALS (updated)
by haukex (Archbishop) on Jul 20, 2018 at 20:37 UTC | |
by Veltro (Hermit) on Jul 20, 2018 at 21:26 UTC |