I have a perlscript called swap.pl an want to start it several times with another perl script to use my 4 CPU cores. Each time, the swap.pl script processes a different part of a given dataset. My code looks like:
print TEMP_CTRL "$_"; # contains information for swap.pl
system("swap.pl"); # swap.pl reads temp_ctrl to know which part of
+ the dataset to process
The problem is, that the system command waits until the process is finished, which means there is no parallelization at all. And the problem with exec command is that it does not return.
Can anyone help?
UPDATE: Thanks for the suggestions. I found
to work well.