Greetings, and thanks! My feeble understanding is that killing the parent does the same for children in the same process group, or session, or whatever :-). Is this not the case with mini-proveall?
Take care, Robert Boyer <[EMAIL PROTECTED]> writes: > Very remotely possibly of relevance to your p-or stuff. > > Very possibly absurdly obvious and a waste of your time. > > Below is a Perl subroutine that has been in the back of my > mind to send to you. > > The following killpid Perl code may be of interest to you > because of the way that it kills off a process's > sub-processes. I had never heard of the cool "pstree" > before. I don't understand it at all, but "it seems to > work". > > sub killpid { > ($pid) = @_; > $_ = `/usr/bin/pstree -p $pid`; > @pids = /\((\d+)\)/g; > foreach $p (@pids) { print "killing", $p, "\n"; kill 9, $p;} > foreach $p (@pids) { waitpid $p, 0;}} > > > Bob > > ------------------------------------------------------------------------------- > > Some probably very irrelevant context: > > I got this file from a grad student here named John Erikson, > [EMAIL PROTECTED] > > #!/usr/bin/perl > use POSIX; > %tests = ( > "01" => ":mini-proveall", > "02" => ":mini-proveall",); > sub killpid { > ($pid) = @_; > $_ = `/usr/bin/pstree -p $pid`; > @pids = /\((\d+)\)/g; > foreach $p (@pids) { print "killing", $p, "\n"; kill 9, $p;} > foreach $p (@pids) { waitpid $p, 0;}} > $num = $ARGV[0]; > $tname = "testa-$num"; > $timeout = 5; > $pid = fork(); > if(!$pid) { > $SIG{INT} = sub { print "SIGINT!\n"; }; > open(IN, "|/usr/bin/time --output=./results/${tname}.tim /p/bin/xa > > ./results/${tname}.dat"); > print IN "$tests{$num}\n"; > close IN; > exit 0;} > $SIG{INT} = sub { $secs = $timeout; }; > $secs = 0; > while(!waitpid($pid, WNOHANG) && $secs < $timeout) { sleep 1; $secs++;} > if($secs >= $timeout) {killpid $pid;} > close OUT; > > > -- Camm Maguire [EMAIL PROTECTED] ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah _______________________________________________ Gcl-devel mailing list Gcl-devel@gnu.org http://lists.gnu.org/mailman/listinfo/gcl-devel