All,

I have a script that utilizes www::mechanize to download and categorize a
huge amount of internet content (similar to a search engine). I'm using a
hash to store and limit concurrent threads to reasonable number; as well as
sharing hashes between threads (threads::shared); At seemingly random
intervals the script crashes with an error like "Free to wrong pool 223f98
not 1d3d210 at D:/Perl/lib/XSLoader.pm line -1.". Anyone have an idea what
this error means or why this is happening? Is there a better way to limit
concurrent threads?

ActivePerl-5.8.8.817
WinXP & Win2k Server


- Chris





for my $Host (keys %notvisited){

                if (!$threadarray{$Host}) {     # No thread already launched
for $Host
                        while ((scalar keys %threadarray) >= $MaxNbOfThread)
{
                                sleep 1; # $MaxNbOfThread thread running
reached, so we wait
                        }
                        
                        $threadarray{$Host}=1;          # Semaphore to tell
thread for $Host is active
                        my $t = threads->create(sub{DoTheThing($Host)});
                        if (!$t) { error("Failed to create new thread\n"); }
                        
                        $t->detach();   # We don't need to keep return code
                }
        
}


sub DoTheThing{
        my $thehost=shift;
        #uses www::mechanize to download $Host
}

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to