ohadk has asked for the wisdom of the Perl Monks concerning the following question:
Do you have any idea why it took at least 1 second to start the 'finish' command? (I am using Unix server, and perl 5.10)sub parallel_execute { my $this = shift; foreach my $a (@a_array) { my $pid = $this->{fork_manager}->start and next; my $res = $a->passes_thresholds(); $a->{timer} = Benchmark::Timer->new(); $svc->{timer}->start; $this->{fork_manager}->finish(0,{a => $a, plugin_result => $re +s}); } } $this->{fork_manager}->run_on_finish( sub { my ($pid, $exit_code, $ident, $exit_signal, $core_dump, $data_stru +cture_reference) = @_; my $a = $data_structure_reference->{a}; if (exists $a->{timer}) { $a->{timer}->stop; debug "took: " . $a->{timer}->report; } });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parallel::ForkManager takes too much time to start 'finish' function
by Corion (Patriarch) on Oct 29, 2018 at 13:35 UTC | |
by cavac (Prior) on Oct 29, 2018 at 15:59 UTC | |
| |
|
Re: Parallel::ForkManager takes too much time to start 'finish' function
by ikegami (Patriarch) on Oct 31, 2018 at 01:39 UTC | |
|
Re: Parallel::ForkManager takes too much time to start 'finish' function
by ohadk (Initiate) on Oct 31, 2018 at 10:51 UTC |