Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use threads ('exit' => 'threads_only'); use Thread::Queue; #create child threads my $childs = 2; my $Q = new Thread::Queue; my @kids = map threads->create(\&processData, $Q), 1 .. $childs # this is how queue work for the processData() once I get some work to + do $Q->enqueue($work); sleep 1 while $Q_->pending > $childs; ### How I can check for any errors in a thread here? #Join all the child threads once every work is done $_->join for @kids;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Threaded Perl script not responding
by BrowserUk (Patriarch) on Aug 15, 2011 at 20:41 UTC | |
|
Re: Threaded Perl script not responding
by zentara (Cardinal) on Aug 16, 2011 at 11:46 UTC | |
by Anonymous Monk on Aug 17, 2011 at 18:00 UTC | |
by zentara (Cardinal) on Aug 17, 2011 at 19:49 UTC |