title: Is it possible to send one message to multiple receiving sockets in constant time?
body: <p>This is more on the general side, but I have lately had the need to send a lot of messages received via a WebSocket API to multiple child processes via UNIX domain sockets in python. Pure threads are no alternative since I need true concurrency (Hope I am not confusing it with parallelism) and so only processes remain. Sharing memory between main and child-processes introduces a bigger overhead than having all of them just listen on their own socket. </p>
  
  <p>The procedure looks as follows: </p>
  
  <ol>
  <li>Thread in the main process listens to incoming WebSocket message and puts them into a queue</li>
  <li>Main process busy-spins and checks for new messages in the queue, if there is one, it sends it to multiple (probably around 3-4) child processes.</li>
  </ol>
  
  <p>After profiling the above script, I found out that it takes around 3msec per child process to send a message. Considering the need for a high throughput, I would rather have to wait 3msec per message than 9msec in the case of 3 child processes. Would there be any possibility to cut this time from O(n) to O(1)?</p>
  
  <p>So far only async has come to mind, but I would like to not use it if possible.</p>