Click to See Complete Forum and Search --> : Forking multiple processes


minulescu
05-31-2007, 07:50 PM
I'm pretty new to Perl and programming, and have a pretty heavy project ahead of me, so any help, however basic, would be much appreciated.

I basically have a list/array of different files that need to be worked on. There could be up to 15 files. And the work that needs to be done on them would take about 10 minutes for each.

Now, I think that it would possible for me to accomplish this task efficinetly using fork(), but I don't quite understand how I would do this. I basically want one parent process with up to 15 children, and need the children to communicate that all the work was done with no errors.

Obviously, I think something like this wouldnt work.

foreach $file (@fileArray)
{
fork()
if(parent)
wait for children to finish working
eventually report on all the work done by children
if(child)
do work
report back to parent
}

So, how would I accomplish something like this, any ideas?

Thanks in Advance!
}

minulescu
07-18-2007, 02:34 PM
Bump.. cmon.. no one here knows how to fork multiple processes?