Hello,
I have been using the Thread::Pool module in one of my scripts to process plenty of files, as follows:
my $threadpool = Thread::Pool->new({
'do' => \&my_function,
'optimize' => 'cpu',
, 'workers' => 20,
});
$threadpool->job($_) for (@myfiles);
$threadpool->shutdown();
sub my_function {
my ($file) = @_;
...
return 1;
}
From time to time I am receiving the following:
Scalars leaked: 1
Scalars leaked: 1
Scalars leaked: -1
Scalars leaked: 1
and sometimes I am receiving a segmentation fault error:
(/bin/sh: line 1: 10999 Segmentation fault /bin/my_script.pl)
I am not sure what's going on and how to debug this. Does anybody have any idea?
Many thanks,
George