in reply to Keep Two Processes Going

Depending on the details of what you want from the kids, there are several ways.

  1. Parallel::ForkManager lets you set a maximum number of processes which all have the same code. When one exits, another will appear.
  2. A $SIG{CHLD} handler can arrange to replace a finished process with another.
  3. A wait loop can fork a replacement.

What do your processes do? It's not clear from your description that either process needs to exit until the work is done.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Keep Two Processes Going
by blax (Sexton) on May 29, 2004 at 05:23 UTC
    Hello,

    First off, thank you for your reply. I believe signals will work gret.

    <snip> It's not clear from your description that either process needs to exit until the work is done. </snip> I am not trying to be an asshole, but I didn't think I needed to be clear as to why I needed two processes running at the same time. I thought I could just say it. But since it may help, here is my response.

    The process is nget. Nget is a command-line usenet binary grabber. The reason that I want two ngets to run at the same time is so that I have two connections to my usenet provider. Without at least two ngets running I don't get as good of download time (Retrieving articles then assembling takes some time away from downloading).