You could
- setup a communication pipe between the two processes and use a non-blocking select to determine if information is there to be read...
- or use SIGHUP, regardless of what anyone thinks it's reserved for...
- do the kill/respawn thing, but I think that's going to be widely regarded as an ugly option
- I think a fork per sleep cycle is even worse than the above option.
- Do the single process thing, with a non-blocking select to determine if there is input to read
Personally, I believe the first or last options are the better options...
-Scott