in reply to Re^3: What is the correct way to finish multithreaded program?
in thread What is the correct way to finish multithreaded program?
I'm pushing undef into the queue with
and I think this will cause thread to return:foreach ( 1 .. $config->{number_of_threads} ) { $q->enqueue(undef); }
Also I have Finishing worker [SOME_ID] in the output...while ( my $org = $q->dequeue() ) { parse_org( $org, $mech ); $pq->enqueue($org); } say "Finishing worker [$thread_id]"; return;
In Section
Seekers of Perl Wisdom