in reply to Problem with monitoring running tasks

The problem with using locks is that you can introduce very subtle, non-obvious, deadlocks into your program and it sounds like this might be what you are experiencing (two threads not doing anything and nothing completes), though I can't see any obvious issues with the code you've posted

I would suggest, in addition to using debug mode, strict and warnings, to re-write your script in a manner to get rid of using locks (for instance, if your queues are Thread::Queue objects, you don't need to use locks here - these objects are thread-safe)

  • Comment on Re: Problem with monitoring running tasks