24.6.4 Using kill for Communication

Here is a longer example showing how signals can be used for
interprocess communication. This is what the SIGUSR1 and
SIGUSR2 signals are provided for. Since these signals are fatal
by default, the process that is supposed to receive them must trap them
through signal or sigaction.

In this example, a parent process forks a child process and then waits
for the child to complete its initialization. The child process tells
the parent when it is ready by sending it a SIGUSR1 signal, using
the kill function.

This example uses a busy wait, which is bad, because it wastes CPU
cycles that other programs could otherwise use. It is better to ask the
system to wait until the signal arrives. See the example in
Waiting for a Signal.