Thanks, I've started rewriting my programs with Win32::Process::Create(), and Wait(), and that's solved my problem.
I have never examined the return values from alarm(), so it may not have been fully functional, but was quite useful nonetheless. The problem with Windows 2003 is that the timeout never occurs.
I used it when calling processes that risk hanging. For example some proprietary so-called 'batch' routines that stupidly report errors with alert boxes. I started a countdown with alarm() based on expected time-to-complete, and if it timed out before the process returned, I'd kill the process to get rid of the alert box. If not, I'd cancel it with alarm(0);
I also used it with Openwebload (from Sourceforge) which calls a GIS web site every few minutes and examines the result to see if a map was actually generated as a result of the call (if not, it restarts various processes). Unfortunately, if IIS is not running, Openwebload gets into an endless loop consuming 100% of CPU resources, and here alarm() was a useful safety valve allowing me to break out and kill it.
So Win32::Process::Create(), and Wait() now do this, and it works fine. It will take me a while to rewrite all my scripts, though, so it is a pity that Windows 2003 has broken some useful (partially implemented) perl functions.
thanks,
David | [reply] |