Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: threads hang

by BrowserUk (Patriarch)
on Jan 17, 2008 at 16:17 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-23 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found