trala has asked for the wisdom of the Perl Monks concerning the following question:
I am launching an external program through perl on Windows. Most of the time, everything goes well. But sometimes, the program decides to throw up a click-through error message. I don't want to babysit the script - if the program hangs, kill it and return an error. I could timeout the process, but there is no good way to know how long it will take - it varies on a case by case basis. So I thought maybe I could check every so often and see how much CPU resources the process is using... then if it stops using the CPU for a while, kill it. Is there a way to check CPU resources based on a process ID? Or maybe there is a better way to do this?
Thanks in advance, Laura
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Kill a process if it hangs
by perrin (Chancellor) on May 15, 2002 at 16:21 UTC | |
by trala (Initiate) on May 15, 2002 at 19:54 UTC | |
by Anonymous Monk on May 15, 2002 at 19:37 UTC | |
|
Re: Kill a process if it hangs
by thunders (Priest) on May 15, 2002 at 20:07 UTC |