I want to do some IPC for process P
and process Q
in the local PC. P
needs notify Q
with messages, so does Q
. Now I consider anonymous pipes, which can be used for IPC on local machine. In my case, I can create two pipes in two separate threads, one is for P
writes to Q
and Q
reads from P
, the other is for P
reads from Q
and Q
writes to P
. This could work, but I feel it is imperfect.
It could be better, if I can have a message center, P
and Q
register event handler for the events they feel interested in, then both P
and Q
can write messages (data) to this message center. That is, I hope P
or Q
can be notified once some messages received. I'm unclear on which way is best to implement this.