Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Alarms with ActivePerl do not work properly

by tokpela (Chaplain)
on Jan 12, 2011 at 22:37 UTC ( [id://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 (Archbishop) 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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://882001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2026-01-24 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (126 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.