sub start_fork_run{ my $self = shift; my ($xml_ojects_ref,$night_run_flag) = @_; my @childs = (); #Get father PID my $father_pid=$$; #Get father SN my $fatherSN = $self->getSN(); if (!$fatherSN){ printer::Logger_screen_message("error","can't get father's SN from DB",0,$logger); exit 1; } #Start fork foreach my $xml_obj (@{$xml_ojects_ref}){ my $pid = fork(); if ($pid) { # parent push(@childs, $pid); $framework_child_procs{$pid} = 1; }elsif($pid == 0) { # child my $results = new testProcess($xml_obj,$fatherSN,$gui_sync_file,$father_pid,$night_run_flag); exit 0; }else { printer::Logger_screen_message("error","couldnt fork: $!",0,$logger); exit 1; } } #Wait for to end foreach my $child (@childs) { my $tmp = waitpid($child, 0); delete $framework_child_procs{$child}; printer::Logger_screen_message("info","done with pid $tmp",0,$logger); } #End the whole topology run $self->finishRun("finish"); }