If you happen to target Windows platform (I know article does not), don&#x27;t reinvent the wheel. There are NT Job Objects [1] for this. The &#x27;target&#x27; process creates the job with `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` set and keeps the job handle open. &#x27;dependend&#x27; processes (by default all children spawned by &#x27;target&#x27;, but you can add more) will all be killed when the &#x27;target&#x27; process terminates, no matter how is terminated. Jobs can do more, like cap CPU&#x2F;IO&#x2F;Memory for the job.<p>[1] <a href="https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;ms684161(v=vs.85).aspx" rel="nofollow">https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;ms6...</a>