I am trying to run an application that will create multiple threads, do work for all the threads, cleanup the threads with a join, and repeat. I get the following error:
What can I do to work around this problem? There was only one post associated with this and it did not answer my questions."Free to wrong pool 1e76ba8 not 15d26e8 during global destruction."
Thanks :)use threads; use threads::shared; our $SHARED_DATA : shared; our @threads = (); # threads our $FINISHED : shared = 0; # for simulation state main(); main ( process() ) init( for () { push @threads, threads->new (\&Foo::run()...); } ) process( init(); finish(); ) sub finish { # our (@threads); { lock $FINISHED; $FINISHED = 1; } $_->join for @threads; } ################### # my class ################### package Foo; use threads; use threads::shared; sub new {} sub run { dothings() {lock $FINISHED; return if $FINISHED;} } sub dothings { lock ($SHARED_DATA); # ... }
-P0w3rK!d
Minor edit per author - dvergin 2003-06-06
In reply to Threads: Free to wrong pool by P0w3rK!d
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |