I also miss any reference to wait()/waitpid() on the article, it looks like the author isn't really confortable with UNIX systems programming.
This can not be achieved using a pattern equivalent to { ... }.
The parent process itself might be abruptly killed, and the finally blocks / destructors / atexit hooks are not run in this case.You call waitpid() directly, configured for timeout, and if it returns with error that the process is no longer available, then act upon it.
* parent process is killed after it forks, but before it calls `waitpid`. Nothing even attempts to kill&wait for the child
* parent process is killed after it issues `waitpid` syscall. The child continues to happily execute while the parent is dead.
- yeah this one is a bummer, write the child pids, collect them via a watchdog process