Ok, here's the rough steps:
1. Set up a pipe
You can use a named pipe for an independent monitor process or anonymous if you use fork+exec to create the two different processes.
2. Then the monitor process waits on the pipe using select, with a timeout - how large that timeout should be depends on how long you are willing to wait for your application, which in turn depends on the type of system you are designing. Don't make it TOO short, or you'll run into trouble.
http://linux.die.net/man/2/select
3. If the select call times out, then you know that the process didn't send a message, so you restart the system [code]system("shutdown -r now");/code] assuming you have the rights to do that [and if you don't, you are stuffed].
The target application should write to the pipe more often than the timeout. Depending on your applications design and behaviour, you could have a watch-dog tickler in the main loop, or scattered a bit here and there.
If you start the monitored process from the monitor process, you could also set up a SIGCHILD handler and detect if the child process falls over - then you have a choice of restarting the whole system or just restarting the process itself.
--
Mats