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