Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: threads hang

by BrowserUk (Pope)
on Jan 17, 2008 at 16:17 UTC ( #662905=note: print w/ replies, xml ) Need Help??


in reply to Re^2: threads hang
in thread threads hang

if i ran the script with 10 threads i would get about 4-7 threads that would hang.

Quite possibly symptoms of the same problem on a multi-cpu system rather than my single cpu system?

You could try addressing the issue that moritz raised, by changing your loop to:

while( my $left = $q->dequeue_nb ) {

And see if that helps any. If not, try generating a standalone demo of the problem (using ping) and post a perlbug report. Maybe whomever there fixed the problem for 5.10 will recognise the symptom and be able to offer a patch against 5.8.8?

Beyond that, I can't see any way of avoiding the bug, as it also affects piped opens. The alternative might be to use NET::SNMP to do whatever the executable your using is doing. Perhaps too painful to reproduce?

One thing that route does have going for it is a non-blocking mode that appears to work quite well, which mean that you could avoid using threads altogether.


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.


Comment on Re^3: threads hang
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-07-07 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls