I am spliting my soft real-time application into two processes, one is the gui and the other is the hardware communications. I would like to to have both processes monitor each other as they send data back and forth. When one detects that the other has crashed it will launch it again and continue normal operation. Would it be wise to set this up as a Peer-to-Peer style communications so that the one that crashes now becomes the client and the other other becomes the server. I was thinking of using tcp/ip locally as my interprocess communications, is this a good idea, is there something better? My Target OS is Minimal Ubuntu.

I'd try and stay away from allowing the mutual dependency between the two processes. If either of the two of them could fail (another question is why is it ok for them to fail) then you have a bad race condition.
It might not fit what you want to do but I'd set this up something similar to the following:
- Create a driver program that spawns each of the two processes you wish to control
- Attach to these processes with ptrace
- Monitor for exit conditions
- Respawn as necessary
This allows you to keep the logic of managing the processes as simple as possible without having either process aware of the others state.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.