title: How to send a message from parent process to multiple fork children?
body: <p>I have a server that allows clients to connect and I am using <code>select()</code> to manage new connections or incoming messages from already connected clients. For every 2 clients connected I create a child using <code>fork()</code>, remembering their file descriptors.<br/><hr/>I want the child processes to wait for parent to send information along with the file descriptor of the socket associated with the client that sent that information. All the children read this and only the child associated with that client performs a certain task with that information while the rest of them go back to waiting to read a new message from parent (the other child does this as well after finishing that task).<br/><hr/>My idea would be to write the message in a fifo file, copied on newlines by <code>nr_of_children</code> times (otherwise only one child could read as the information is consumed) and to have the child processes read from it, using a lock on the fifo so only one process reads a line at a time.<br/><hr/>Is there a better way to do this, and if not, is my idea going to do the job?
  Thank you.</p>