Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: Speeding up/parallelizing hundreds of HEAD requestsby BrowserUk (Patriarch) |
on Sep 17, 2007 at 22:11 UTC ( [id://639505]=note: print w/replies, xml ) | Need Help?? |
You could add two lines to your code above to achieve your goal.
Of course, a complete solution would add a few more lines in order to terminate slow or absent mirrors. And a couple (2 or 3) more to share the results of the asynchronous calls with the main thread of the code. The total absence of the word "threads" from your question and responses suggests that you will not consider such a solution...and I've gotton out of the habit of expending time producing and testing solutions that will likely simple be ignored. But for the problem you are trying to solve, threads is the simplest, fastest, easiest to understand solution. It is also the case that I am not currently in a position to offer a tested solution, and unfortunate that even those here that do not dismiss threads as a viable solution, rarely seem to offer code. C'est la vie. 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.
In Section
Seekers of Perl Wisdom
|
|