Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Hanging Threads

by Ninthwave (Chaplain)
on Aug 18, 2007 at 05:48 UTC ( [id://633433] : note . print w/replies, xml ) Need Help??

in reply to Hanging Threads

Where do you test for the UNDEF that ->dequeue_nb returns when it hits the end of the queue?

To quote Thread::Queue
"dequeue_nb The dequeue_nb method, like the dequeue method, removes a scalar from the head of the queue and returns it. Unlike dequeue, though, dequeue_nb won't block if the queue is empty, instead returning undef. "
"No matter where you go, there you are." BB

Replies are listed 'Best First'.
Re^2: Hanging Threads
by WalkingZero (Sexton) on Aug 18, 2007 at 05:50 UTC
    Arg if you read the previous reply ignore it. I need to read more clearly. I am using the Queue's pending function and testing for that in the while loop. Like I said the loop breaks cleanly. it just hangs in the sub though for some reason.