我在一台Linux主机上运行一个perl脚本。我正在尝试编写一个fork脚本,其中子进程启动一个程序,而父进程在5秒后超时,从而杀死子进程。my $childPid = fork(); # I am the parent, and $childPid is my child if (time() > $start + $timeOut) {
solverprocess.poll() == None` instead of try didn't work either solverprocess.killexcept TimeoutException:# Cancel alarm if it's still active然而,它有时会不断产生孤立进程