As cdarke said, under windows perl emulates fork with threads, and that is likely to break if you call exec in the child threads.

It has been a long time, but in the past, I have had success with Win32::Process. I suggest you use that to start each of your worker processes, and store the process objects of each in an array or has in the parent perl process. Then when they have all started, just call $ProcessObj->Wait($timeout) on each in a loop until they all quit.

The other thing I would do would be to experiment with starting instances of familiar windows GUI programs such as notepad that you can easily quit manually, so that you can quickly get things working before switching to long running programs.


In reply to Re: Main program exits even before the child process completes on windows by chrestomanci
in thread Main program exits even before the child process completes on windows by vivekarcot

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.