ithreads and Devel::LeakTrace

[email protected] ((David Shapiro))
Newsgroups perl.ithreads
Organization PerlDiscuss.com
Message-ID <[email protected]>
Anybody use Devel::LeakTrace on their ithreaded applications?  I get leaks
out the wazoo for the simplest things.  Sometimes it just get segmentation
faults.

Try with: perl -MDevel::LeakTrace test.pl.  

put in file test.pl:

use strict;
use threads;
use threads::shared;

for (my $count = 0; $count < 2; $count++) {
   eval {
      my $thr = new threads(\&oof,$count);
   };
}

my @threads = threads->list();

foreach my $thr (@threads) {
   my $result = 0;
   $result = eval {
      $thr->join();
   };
  
   if ($@) { 
      warn "Exception in thread: $@\n"; 
   } else { print "returned: $return\n"; }   <--- error about can't join
detached thread

}

sub oof : locked method {
   my $count = shift;
   print "count: " . $count . "\n";
   return 1;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.