0

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.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by L7Sqr
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.