I am curious to learn more about this application.
Unfortunately I don't have a *nix system to test on right now although I often have several (some rebuilds of my environment are in progress).

With unix you can start multiple processes "in the background".
$> program_a 1 2 &
$> program_a 3 4 &

A Unix process started in this way runs at a lower priority than the process that started it. Also I think, if you die, they die also. This is different than a detached separate process which will keep running even if you die. A process like that can even have a higher priority than the process that launched it.

You can scan the pid table (ps command) to see if program_a is still running. What is the need to determine which instance of program_a is running? Does it really matter if you can identify that the instance of program_a which was called with parms 1 2 vs 3 4 is running? Maybe not? Maybe so?

If Perl can't deliver the PID of a new process, you can scan process table and then re-scan to see the new PID that shows up when Perl says "hey", system command worked".


In reply to Re: background system() and stillalive() sub by Marshall
in thread background system() and stillalive() sub by iaw4

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.