in reply to dbi and fork

When you fork off a child, you get the pid of it.
One way would be to send each child a signal, though signal handling is reported to be not very stable.

Another way could be to kill the whole process family when the parent is killed.

Yet another way is to establish some communication (pipes, sockets) between parent and children.

Next way could be to use a framework like poe.