Posted on 2010-07-31 16:23:28.384128-07 by jdhedden in response to 12859
Re: block until one thread is joinable?
My recommendation is to set up a Thread::Queue. Threads that are done working would then put their thread ID on the queue before terminating. The main thread would then monitor the queue for any IDs, and then using the ID, would join with the thread and process its results. The 'threads' module on CPAN has a 'examples' directory with two scripts that do just this.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.