in reply to Safety of using alarm
(
One problem can be with that approach, is that the program is frozen (or just waits too much) in a system call (most probably reading),
you won't get the $SIG{ALRM} handler delivered until it's finished.
Also, it can also be a problem if the program uses alarm. Note that on some systems, the sleep function may use alarm.
) deleted -- I didn't read the question properly. The third paragraph still holds.
You might be better setting a cpu limit with the ulimit or setrlimit syscall, although I'm not sure how you can do that in perl.
|
|---|