mlin has asked for the wisdom of the Perl Monks concerning the following question:
If I want to deal with these files parallelly, like using 4 processors, I think I must establish 4 pipes first(right?), then how to tell the perl to use these pipes automatically? I'm a little confused about the progress. Could you please tell me some schemes to solve this problem and give me some explanation? Thanks a lot! ----- complement: If while the program A runs, it usually print some information or warnings to the screen? Will it be a trouble for the forked processes? or I must throw the output of A, like:open $h, "| program_A" or die ...; foreach (@data_files) { print $h ...; print $h ...; ... } close($h);
foreach (@data_files) { open $h, "| program_A 2>& /dev/null" or die ...; print $h ...; print $h ...; ... } close($h);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to set pipe first and then use the forkmanager?
by BrowserUk (Patriarch) on Sep 22, 2016 at 09:22 UTC | |
by mlin (Novice) on Sep 22, 2016 at 10:51 UTC | |
by Laurent_R (Canon) on Sep 22, 2016 at 14:57 UTC | |
by mlin (Novice) on Sep 23, 2016 at 09:57 UTC | |
by Laurent_R (Canon) on Sep 23, 2016 at 11:39 UTC | |
|
Re: How to set pipe first and then use the forkmanager?
by marioroy (Prior) on Sep 22, 2016 at 14:23 UTC | |
by mlin (Novice) on Sep 23, 2016 at 09:40 UTC | |
|
Re: How to set pipe first and then use the forkmanager?
by tybalt89 (Monsignor) on Sep 22, 2016 at 13:56 UTC | |
by mlin (Novice) on Sep 23, 2016 at 09:43 UTC |