in reply to fixed set of forked processes

What kind of data do you want to pass back from the children to the parent?

Is it just some boolean indicating failure/success, a line of text or some complex data structure?

Replies are listed 'Best First'.
Re^2: fixed set of forked processes
by anonymized user 468275 (Curate) on Dec 02, 2010 at 18:11 UTC
    no data. not even failure or success, child capable of handling its own results. But the parent does need to know how many children are left running and update to OP: I also would prefer to avoid spawning a unix grep of unix ps to count subprocesses - that is also an unwanted overhead.

    One world, one people

      Your parent process will know the PID of each child process, so you can kill 0, $pid to see if it's running. Not sure what the performance implications are.

      Since you were mentioning ps & grep, I thought I'd mention this simple alternative.

      If all you want is to know if children are alive or dead, you might want to look into $SIG{CHLD} which tells you when kids die. That's in perlipc too.

      --Pileofrogs