--- loncom/lonmaxima 2007/11/09 18:51:10 1.35 +++ loncom/lonmaxima 2008/08/19 09:46:36 1.38 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # Connect to MAXIMA CAS # -# $Id: lonmaxima,v 1.35 2007/11/09 18:51:10 albertel Exp $ +# $Id: lonmaxima,v 1.38 2008/08/19 09:46:36 riegler Exp $ # # Copyright Michigan State University Board of Trustees # @@ -134,7 +134,9 @@ sub catchexception { sub child_announce_death { $SIG{USR1} = \&child_announce_death; - $extra_children++; + if ($extra_children < $PREFORK*10) { + $extra_children++; + } } # ---------------------------------------------------------------- Main program @@ -268,12 +270,12 @@ sub make_new_child { $command->log_stdout(0); #$command->log_file("$execdir/logs/lonmaxima.session.log"); - &sync($command); for (my $i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) { &status('Accepting connections'); my $client = $server->accept() or last; - print $command ("display2d:false;kill(all);\n"); + &sync($command); + print $command ("display2d:false;kill(all);reset();\n"); &getmaximaoutput($command,2); &sync($command); my $syntaxerr = 0; @@ -299,7 +301,7 @@ sub make_new_child { kill('USR1' => $ppid); print $command ("quit();\n"); # tidy up gracefully and finish - + sleep(15); $command->soft_close(); # this exit is VERY important, otherwise the child will become