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

Re: system() with timeout

by valdez (Monsignor)
on Mar 18, 2004 at 15:59 UTC ( [id://337715]=note: print w/replies, xml ) Need Help??


in reply to system() with timeout

... and if you are lazy, take a look at IPC::Run :)

Ciao, Valerio

update: many thanks to waswas-fng (who was not lazy)

Replies are listed 'Best First'.
Re: Re: system() with timeout
by waswas-fng (Curate) on Mar 18, 2004 at 16:15 UTC
    One thing I have been bitten on before using IPC::Run is pty issues on heavy loaded machines -- it caused a hard to track down error for me. from the pod:
    =item pty Support

    If you need pty support, IPC::Run should work well enough most of the time, but IO::Pty is being improved, and IPC::Run will be improved to use IO::Pty's new features when it is release. The basic problem is that the pty needs to initialize itself before the parent writes to the master pty, or the data written gets lost. So IPC::Run does a sleep(1) in the parent after forking to (hopefully) give the child a chance to run. This is a kludge that works well on non heavily loaded systems :(.


    -Waswas


    Update: I am not saying its a bad module, just that I have hit the pty issue before and it was a PITA to track down. My fix was to change the sleep 1 to sleep 2 in the module, but there is still a race condition there you just make it a little less likely to happen.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2025-06-19 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.