I have a multi threaded Perl script (master-workers architecture) in which the workers call an external application and need to process the standard output and standard error. I tried Capture::Tiny but that crashed the worker threads if a lot of workers were busy processing. Now, I use IPC::Run3 but this also fails, although less often as Capture::Tiny. Is there a safe way to call external applications from parallel running worker threads and being able to process the standard output and standard error? The idea is that the external calls can run in parallel so semaphore locking seems not the way to go to me. My current run3 call
my @spaziooptions = ($spaziocmd, "-m" , $transref->{'QMANAGER'} ,"-q"
+, $destination_queue, "-i" , $transref->{'POLLERFILE'} ,"-d" , $desti
+nation_filename , "-k" , $transref->{'DATATYPE'}, "-s", $global_hostn
+ame, "-c", $cor_id);
my $cmdout;
my $cmderr;
run3 \@spaziooptions, \undef, \$cmdout, \$cmderr;
my $cmdexit = $?;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.