On Solaris 10, I have a parent and child process. I kill the child process with kill -KILL. I want the fastest possible detection of this in the parent process (this is a master/slave system and the goal is for the parent to request its backup to take over as fast as possible). The parent process needs to know that the child has started to exit (it doesn't need to wait until the child has exited).
In the system I'm working with I see a delay of about 200ms between sending the SIGKILL and the parent process receiving the SIGCHLD. I don't think I can reduce this time, simply because of the size of the child process and the time it takes to exit - correct me if I am wrong.
I think my options are: -- Don't send SIGKILL to the child. Send a signal to the parent instead, so that it can kill the child (and therefore knows instantly that the child process is being terminated). This is not ideal because some of the "kill -KILL" commands are out of my control so I can't replace them with a different signal to the parent. -- Hook into the termination processing on the child (I don't think this is possible because SIGKILL can't be caught). -- Any other ideas?
Thanks for any advice. NickB