![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: thread save calling an external commandby salva (Canon) |
on Jul 06, 2016 at 09:26 UTC ( #1167289=note: print w/replies, xml ) | Need Help?? |
There is a very simple solution to that problem: Redirect the output of every child process to temporary file and once it terminates, read it back for processing. That way you only have to take care of concurrently launching and reaping processes, forgetting about the IO.
It may seem pretty inefficient forcing the data through the file-system, but in practice, usually it is not unless the slave processes write huge quantities of data.
In Section
Seekers of Perl Wisdom
|
|