So far, I find no functions that will determine if a thread has exited outside of join(). The obvious issue with join is that it blocks so I need a join thread for each worker thread so that I can send a message back to the Boss to restart the thread. This seems to wildly increase the memory usage. There are large shared data structures in this program and it already seems to be at the memory limits of the machine without these join threads.
Is there a way to remove the shared variables from the join threads so that they take up as little memory as possible?
Better yet, is there a way to detect thread deaths outside of a dedicated join thread, perhaps a $thread->ready_for_join() type function or a $thread->join_non_blocking() or even a $thread->join_any_of_these(@threads)?
Thanks
-Eric