Processes with timeout
Mark Borgerding
mark at borgerding.net
Mon Apr 19 22:07:40 EDT 2004
Markus Franz wrote:
> How can I make it sure that every child-process terminates after x senconds
> (wether it has finished or not)?
> I don't know how to force a child-process to kill itself after x seconds. I
> also don't know how to force a main process (parent) to kill a child-process
> after x seconds.
signal.alarm(x)
# after x seconds, a SIGALRM signal will be sent to the current process
# (even if the contents of the process changes via exec* )
-- Mark Borgerding
More information about the Python-list
mailing list