title: Speeding up IPC with Ruby
body: <p>I am trying to do IPC between 2 processes on the same Linux box in Ruby, and I need to optimize the solution as far as practicable. </p>
  
  <p>I had begun with a TCPSocket but I see that using UNIXSocket is probably faster, and <strong>perhaps</strong> does not copy data to kernel buffers. </p>
  
  <p>I have been reading SO threads, and looks like mmap might be interesting to look at. But for mmap I need to a) install mmap gem and b) provide locking since multiple client processes would likely try connect with the server process (both running on same box).</p>
  
  <p>My questions: </p>
  
  <ol>
  <li>What other options would you recommend? </li>
  <li>How do you recommend locking the memory with ruby mmap?</li>
  <li>How do the numbers, if there's any available, stack up for UNIXSocket versus mmap?</li>
  </ol>