Keep It Simple, Stupid | |
PerlMonks |
Re: threads hangby moritz (Cardinal) |
on Jan 17, 2008 at 10:03 UTC ( [id://662831]=note: print w/replies, xml ) | Need Help?? |
The dequeue from Thread::Queue blocks until there is an item to return.
Now if you have a race condition between the query of $q->pending and $q->dequeue (another threads empties the queue in between) you can get a block. Try $q->dequeue_nb instead. (Disclaimer: I have no experience with threads, so don't be surprised if that's not the problem...)
In Section
Seekers of Perl Wisdom
|
|