I am trying to make something work here, I have c program where my parent process creates a pipe so he can listen for request from children processes. These children are created dynamically, it is never the same number. So far, I managed to send the requests to the parent through the pipe, and have it synchronized through mutex.
My problem is, this request need an answer provided to the child that made such request, and I can't use the same pipe since its one way, and all the other children will be using it (I already tried and it generates a serious issue)
The next thing I tried was making a pipe before the request on the child and passing the value of the descriptor in the request. Also failed, since the parent doesn't know those descriptors, which I found out after failing.
So now I am clueless in how to make that request response reach the child... I am a beginner with C programming, so, all help is welcomed!
BTW: working in a Unix program, pure C programming
stdinandstdoutfor the pipes, the better. Sockets are another alternative. beej.us/guide/bgipc/output/html/singlepage/bgipc.html is a good source of info. So are Richard Stevens books on UNIX programming.