Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: threads hang

by moritz (Cardinal)
on Jan 17, 2008 at 10:03 UTC ( [id://662831]=note: print w/replies, xml ) Need Help??


in reply to threads hang

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://662831]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found