line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Archer::Parallel::ForkManager; |
2
|
4
|
|
|
4
|
|
976
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
151
|
|
3
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
115
|
|
4
|
4
|
|
|
4
|
|
4514
|
use Parallel::ForkManager; |
|
4
|
|
|
|
|
31500
|
|
|
4
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
0
|
37
|
sub new { bless {}, shift } |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub run { |
9
|
9
|
|
|
9
|
0
|
17
|
my ($self, $args) = @_; |
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
|
|
55
|
my $pm = Parallel::ForkManager->new( $args->{num} ); |
12
|
9
|
|
|
|
|
5166
|
for my $elem ( @{ $args->{elems} } ) { |
|
9
|
|
|
|
|
41
|
|
13
|
20
|
50
|
|
|
|
226
|
$pm->start and next; |
14
|
|
|
|
|
|
|
|
15
|
20
|
|
|
|
|
501
|
$args->{callback}->( $elem ); |
16
|
|
|
|
|
|
|
|
17
|
20
|
|
|
|
|
365
|
$pm->finish; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
9
|
|
|
|
|
175
|
$pm->wait_all_children; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
__END__ |