nuttervm has asked for the wisdom of the Perl Monks concerning the following question:
However when I use the PAR (perl archiver) to create a self contained executable (pp myperlscript.pl -o myperlscript.exe), the parent process stops logging to a filehandle after the first child returns.
If I remove the parallel operations, the script runs in serial mode as a complied executable just fine. I'd rather keep the processing parallel rather than serial so this isn't a very good long term solution for me.
I thought that perhaps the child was closing the parent filehandle, and that is not the case as it is still open. I tried closing the filehandle in the child in case it was blocking somehow, but that doesn't seem to have an effect. I have tried select() ing the parent process file handle and manually forcing a buffer flush via $|=1 but this does not work as expected. If I put the select(FH); $|=1; immediately after the file handle declaration the script will then start printing all parent output to that file handle (including STDOUT).
I'm somewhat out of ideas on what to try next. Does anyone have a nugget of wisdom that might help with my strange combination of events? Are PAR and Parallel::ForkManager oil and vinegar?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |