Is having a "process manager process" a good pattern? This process would have a record of all currently running processes and their children. When you want to create a new process you make a request to the process manager process. When a process is killed the process manager could then kill its children.