Are you talking about a situation like:
A spawns B B spawns C and D C spawns E D spawns F ang G ...
and you want A to know all the sub-processes (B-G) that have descended from it? If so, the proper solution is likely to depend on what OS you're using. In *n*x, you can try looking at Proc::ProcessTable to see if that gives you what you want -- like being able to check processes by their parent-PID (ppid). Apart from that (so far as I know), you'd have to explicitly craft the sub-processes so that they report themselves somehow back to the primary parent (e.g. via pid files or whatever).

But then, if the sub-processes you're spawning are not things that you are crafting yourself, then you're probably stuck with setting up the parent so that it monitors the process table to seek out all its descendants.


In reply to Re: Working With Processes and Their children by graff
in thread Working With Processes and Their children by ketema

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.