spawn and monitor multiple processes - report back when all have completed

B

bayxarea-usenet

I want write a batch routine that will run multiple process - launch
them at the same time - but not return until they have all completed.

This is on Windows XP.

The process I want to call is a command line conversion utility that
will convert CGM files to HPGL files and it can take a while to execute
- currently I have the option to call system on each on in a loop - but
this is in series and means that each process will only start after the
previous one has finished.

I will be passing the batch script a filename of CGM files to convert
so there should be a new process for each CGM file found in the input
data file.

I was thinking of trying to get the process id or something like that
for each process and then monitor them and then return (or write
'FINISHED' to an output file when they all have actually completed
executing.

Is there a best way to handle this on Win32?

John
 
A

A. Sinan Unur

(e-mail address removed) wrote in
I want write a batch routine that will run multiple process - launch
them at the same time - but not return until they have all completed.
....

I will be passing the batch script a filename of CGM files to convert
so there should be a new process for each CGM file found in the input
data file.

I was thinking of trying to get the process id or something like that
for each process and then monitor them and then return (or write
'FINISHED' to an output file when they all have actually completed
executing.

Is there a best way to handle this on Win32?

If you have Perl 5.8, see

perldoc -f fork

Sinan.
 
A

Anno Siegel

I want write a batch routine that will run multiple process - launch
them at the same time - but not return until they have all completed.

This is on Windows XP.

The process I want to call is a command line conversion utility that
will convert CGM files to HPGL files and it can take a while to execute
- currently I have the option to call system on each on in a loop - but
this is in series and means that each process will only start after the
previous one has finished.

That is graphic conversion, a cpu-intensive job. Unless you're running
on a multi-processor, you won't gain anything by running them in parallel.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top