in reply to Re^4: LWP, DBI and Free to Wrong Pool error
in thread LWP, DBI and Free to Wrong Pool error

Check the loop condition, I just moved the sleep. That may not be the only logic error. It was a mind-only exercise and in between watching a movie to boot.

Is the colon ... or does it tie $running to something in threads::shared?

Yes. It makes $running shared by all threads. If you look at the top and bottom of thread(), you'll see that when a thread starts, it increments that variable. And decrements it when it finishes. The upshot is that when all the threads have finished, because they have exhausted the in-bound $Qwork od item to fetch, $running drops to zero and the main thread will see that and terminate.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."