x
Loading
 Loading
Hello, Guest | Login | Register

A Forking Parallel Link Checker

In last month’s column, I presented a framework to allow many parallel tasks to be performed efficiently, in anticipation of using that framework as-is for this month’s program: a parallel web-site link checker. Well, wouldn’t you know it? After writing the rest of the code, I found that I had left out some of the needed hooks. And, while I was on a boat for Perl Whirl 2000 (the first Perl conference on the high seas), I thought of more things I could add to the process manager for the forked-off processes. So, after much gnashing of teeth, I used all of my skills of random feature creep and cut-n-paste, urgh, I mean, code reuse to create the monster in Listing One (pg. 94).

In last month’s column, I presented a framework to allow many parallel tasks to be performed efficiently, in anticipation of using that framework as-is for this month’s program: a parallel web-site link checker. Well, wouldn’t you know it? After writing the rest of the code, I found that I had left out some of the needed hooks. And, while I was on a boat for Perl Whirl 2000 (the first Perl conference on the high seas), I thought of more things I could add to the process manager for the forked-off processes. So, after much gnashing of teeth, I used all of my skills of random feature creep and cut-n-paste, urgh, I mean, code reuse to create the monster in Listing One (pg. 94).

At a massive 655 lines of code, this program exceeds anything that this column could describe in one chunk. So rather than my usual line-by-line description, let me hit just the highlights.

First, let’s look at how many features I added and bugs I fixed in the parallel “let your kids do all the work” process manager from last month, starting here in line 458. One of the more glaringly obvious changes is the breaking of the code into two in-line modules, defined by the blocks starting in lines 460 and 503. Each block starts with its own package directive, in anticipation of being split out into real modules. At this point, we’re ready to give birth to a real module, but I’ve…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Vimperator: Use Firefox the Vim Way
  2. Customize Chrome for Better Browsing
  3. Jetpack Gearing Up for Production: Look Out Chrome?
  4. Google Buzz: Much Ado about Something
  5. Alternative Browsers: Beyond Chrome and Firefox
Follow Linux Magazine
Rackspace