I don't know if I really got your question but, if you want to process 2 know when process 1 write something, I suggest you use a signal from the process 1 to warn process 2 that things are ready to be read.(there are another ways to do this as well)
Since you got both process IDs(pid) you can use kill to send your ready message, so from the process that has done writting, it will be like that:
kill(pid, SIGINT)
And then handle Interrupt signal as you wish:
struct sigaction sigtohandle;
memset (&sigtohandle, 0, sizeof (sigtohandle));
sigtohandle.sa_handler = &read_process;
sigaction (SIGINT, &sigtohandle, NULL);
So you will have a function called read_process() on the signal receiver process that is supposed do the job you desire.
You can read more about processes and signals here:
http://advancedlinuxprogramming.com/alp-folder/alp-ch03-processes.pdf