Home: Perl Programming Help: mod_perl:
How to close perl threads correctly and where to find close.al lib



kk2950
Novice

Jul 2, 2010, 4:48 PM


Views: 30977
How to close perl threads correctly and where to find close.al lib

I write a simple perl thread program recently to do stimulating the users joining the calls. The problem is that it failed to close the thread properly and lead to Out of memory and segmentation fault.

Need help to find the possible solution to fix this problem

Here is the sample code:

use threads;

sub cts_alljoin () {

print "Use the thread to run each function\n";
$test = @ip_address;

for ($i=0; $i<=$test; $i++) {

my $thr = threads->new(\&cts_alljoin_test, @ip_address);
}

#threads->('SIGUSR1');
threads->exit();

}

The result I am getting:

I search for CPAN, but it does not have this specific lab. What am I missing here? Any solution

Can't locate auto/threads/exit.al in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at CTSJOIN.pl line 168