'How to detect death of parent in pre-fork server where all children block on accept()
Suppose I have a pre-fork server. On start up, the server listens on a socket and forks multiple children. All children then block on their accept() system call until a client sends a request, upon which one of the children will handle the request. It is easy for the parent to detect the death of its children by using a SIGCHLD handler. But how can the children be informed about the death of their parent? All the children are blocking on their accept() call, so they would not be able to poll for the presence/absence of the parent.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
