in reply to Working With Processes and Their children
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).A spawns B B spawns C and D C spawns E D spawns F ang G ...
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.
|
|---|