Handle count/Memory leaks using shared arrays

[email protected] (Jean Cormier)
Newsgroups perl.ithreads
Message-ID <[email protected]>
Hi,

I used ithreads to write a diagnostic/monitoring tool that should (ideally)
run permanently in our environment.  I use ActivePerl 5.8 on W2K boxes.  It
works very well but it crashes after a few hours of operation.
The problem seems that I'm using shared arrays.  When I look at the Windows
Task Manager I see that the Memory Usage and the number of Handles grows
continuously causing my crash.

I found this list while trying to figure out what to do.  I saw mentions of
memory leaks in a few places and a statement by Arthur Bergman that they
should be resolved by release 5.8.1.

My questions are :

Is there a place where we have a clear description of the known ithreads
memory problems?

Is there a tentative date for the release of this 5.8.1 version ? ( Is it a
matter of weeks/months/years? )

Is the handle count I observe part of the same problem? a new one? an error
on my part?

Couldn't these known problems be mentioned as bugs in the
threads/threads::shared modules documentation?


This is the skeleton of my test program :

use strict;
use warnings;
use threads;
use threads::shared;
  
my @a : shared = ();
my $a_thread = threads->create(\&athread, \@a );
my $b_thread = threads->create(\&bthread, \@a );

$a_thread->join;

sub athread {
  my ($list) = @_;
  while(1) {
    {
      lock $list;
      print "A = @$list\n";
    }
    sleep 1;
  }
}

sub bthread {
  my ( $list) = @_;
  while(1) {
    {
      lock $list;
      @$list = (1,2);
    }
    sleep 1;
  }
}


Thanks

Curufin
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.