JFarr has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I have a thread question that I have not been able to solve.
I receive this error message:
A thread exited while 7 threads were running, <FILE> line 15.
I'm using "use threads" and "use threads::shared".
basically I have this setup:
PrintOut just prints data to the screen. I know that if I use a join in the first thread call, my problem goes away, except that this drastically slows the program down. Is there a way to stop the first thread from exiting until all the other threads are finsished? Thanksforeach $host (@syshost) { $threadHost = threads->new(\&runSeries, $host); } sub runSeries { my $stuff = @_; < parse through $stuff...and do data manipulation> $threadStuff = threads->new(\&PrintOut, $stuff)->join; }
Back to
Seekers of Perl Wisdom