pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:
What's goin' down in groove-town, Monks?
How do you do something akin to a sig alarm in a multi-threaded perl app?
I have an existing perl app that does something similar to a web crawler. It's multi-threaded and uses LWP::UserAgent to pull web pages. Sometimes the connection times out, and I'd like to make that timeout shorter. The timeout value in LWP::UserAgent doesn't seem to do anything in at least one case. This could be because it's actually chasing redirects or something like that. I personally don't care enough to chase down infinite redirects (or whatever it actually is that's taking so long). If this weren't multi-threaded, I'd do sig alarm. But it is multi-threaded!
And now, even more than the practical answer to my problem, I'd like to know how you do a timeout/sig alarm like behaviour in multi-threaded perl?
Thanks!
--Pileofrogs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Thread Killlin'
by woodpeaker (Novice) on Dec 10, 2008 at 21:11 UTC | |
|
Re: Thread Killlin'
by woodpeaker (Novice) on Dec 10, 2008 at 21:13 UTC |