Thanks for your response. Well, shoot. I tested this again on my Windows 7 machine, actually running from command line (before was running from the built in shell of Komodo Edit) and I do see that it works as expected. I apologize for the incorrect assessment. Tested against a Windows 2008 R2 machine, and saw the correct behavior as well. Windows 2012 R2 however, is still behaving abnormally. I tested on another Windows 2012 (not R2) and found the same problem. I'm glad this is the case, considering the 2012 machine is where we first noticed the problem, and this means we do not all of a sudden have a widespread problem in our code. However, it does not help me solve the problem. Which there is...somewhere.

The trouble is not with the threads terminating (agreed, the message I printed was misleading), but with the system command being run. Perl processes start up, but they do not terminate. Given that I'm executing a single print statement I would expect these processes to disappear rather quickly and not linger until I hit enter in the test script. Have any ideas or advice on how to debug this issue further?

C:\>perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x +64-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2013, Larry Wall Binary build 1801 [297964] provided by ActiveState http://www.ActiveSt +ate.com Built Feb 24 2014 11:06:47 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. C:\>perl test.pl 1 ### Running a perl script ### 0s : Thread 0 - > Creating threads 0s : Thread 1 - Created 0s : Thread 2 - Created 0s : Thread 3 - Created 1s : Thread 0 - All Threads created 1s : Thread 0 - > Waiting for input now. All system commands should fi +nish without pressing enter 3s : Thread 2 - Starting 'perl -e "print \"hello world\""' 3s : Thread 3 - Starting 'perl -e "print \"hello world\""' 3s : Thread 1 - Starting 'perl -e "print \"hello world\""' 68s : Thread 0 - > Input received, all done 68s : Thread 1 - Finished the command: hello world 68s : Thread 2 - Finished the command: hello world 68s : Thread 3 - Finished the command: hello world 68s : Thread 0 - All Threads joined

In reply to Re^2: Running a perl script as a system command in another thread hangs while main thread reading from STDIN by rmahin
in thread Running a perl script as a system command in another thread hangs while main thread reading from STDIN by rmahin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.