process monitoring in c under linux
- by poly
I'm trying to write a multi threaded/processes application and it need to know how to monitor a process from another process all the time.
So here is what I have, I have a 2 processes, each with multiple threads that handle the network part, then another 2 process also with multiple threads that interact with DB and with the network processes, what I need to do is that if for example one of the network processes goes down the DB process start sending to the live network process until the second one is up again.
I'm using fifo between the DB and the network process.
I was thinking of sending messages with message passing all the time but not sure whether this is a good idea or I need to use some other IPC for this issue, or probably neither is good and I need to use entirely something else?
Thanks,