|
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. |