in reply to Re^2: Monitor list of threads running
in thread Monitor list of threads running

So, maybe you want to do something with $thr, then, if you want to monitor the newly created thread? The threads documentation lists various uses for the return value of ->create(). Maybe now is a good time to read that documentation and look for these uses.

Also, again, maybe you really don't want to ->detach threads but to just keep them around and ->join them. Just feed them from a Thread::Queue and wait until they have all finished as all work has been done. But then, I'm sure that approach has already been shown to you.

Replies are listed 'Best First'.
Re^4: Monitor list of threads running
by mr_p (Scribe) on Apr 08, 2010 at 19:29 UTC
    I don't need the workerThreads to wait at all, I just want them in while loop and keep reading from DataQueue, and MasterThread to Just Queue to DataQueue.

    My only concern was to watch and make sure all workerThreads are alive.

    So, I don't know if I can use join() in my case

      Maybe now is a good time to review the threads documentation. The skeleton for a simple Thread::Queue worker approach is outlined by BrowserUk in 735931. Maybe you want to work from that, or do some more research into other posts on the subject on this site.