title: Passing file-descriptors between processes asynchronously
body: <p>I am implementing a web server where I need to make the parent process do the following:</p>
  
  <ul>
  <li><code>fork()</code> new worker processes (a pool) at the beginning.</li>
  <li>Looping forever, listening for incoming requests (via socket communication).</li>
  <li>Putting the socket descriptor (returned by <code>accept()</code> function) into a queue.</li>
  </ul>
  
  <p>and the worker process will do the following:</p>
  
  <ul>
  <li>Once created, loops forever watching the queue for any passed socket descriptors.</li>
  <li>If he takes the socket descriptor, he handles the request and serves the client accordingly.</li>
  </ul>
  
  <p>After looking around and searching the internet, I found that I can send a file descriptor between different processes via <code>UNIX Domain Socket</code> or <code>Pipes</code>. But unfortunately, I can do this synchronously only! (I can send one <code>fd</code> at a time, and I cannot put it in a waiting queue)</p>
  
  <p>So, my question is:</p>
  
  <ul>
  <li>How can I make the parent process puts the socket descriptor into a waiting queue, so that, the request is pending until one of the worker processes finishes a previous request?</li>
  </ul>