Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Alarms with ActivePerl do not work properly

by tokpela (Chaplain)
on Jan 12, 2011 at 22:37 UTC ( #882001=note: print w/replies, xml ) Need Help??

in reply to Alarms with ActivePerl do not work properly

An alternative method to monitor your process could be to execute using Win32::Job and set a timeout using run($timeout).

  • Comment on Re: Alarms with ActivePerl do not work properly

Replies are listed 'Best First'.
Re^2: Alarms with ActivePerl do not work properly
by eyepopslikeamosquito (Chancellor) on Jan 13, 2011 at 07:59 UTC

    Yes, FWIW a few years back I found Win32::Job the least painful way to solve my problem of running a command for a specified period of time, then killing it. I originally did a sigalarm-based Unix version (in Timing and timing out Unix commands); the final Win32::Job-based Windows version can be found in Re: Timing Windows commands. Completely different code for each platform, which is ugly. However, I've found nothing but pain with signals on Windows and always avoid them on that platform, in both Perl and C. Note that the native Win32 API has no concept of signals.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://882001]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2018-02-17 22:32 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (250 votes). Check out past polls.