title: fastest (low latency) method for Inter Process Communication between Java and C/C++
body: <p>I have a Java app, connecting through TCP socket to a "server" developed in C/C++.</p>
  
  <p>both app &amp; server are running on the same machine, a Solaris box (but we're considering migrating to Linux eventually).
  type of data exchanged is simple messages (login, login ACK, then client asks for something, server replies). each message is around 300 bytes long.</p>
  
  <p>Currently we're using Sockets, and all is OK, however I'm looking for a faster way to exchange data (lower latency), using IPC methods.</p>
  
  <p>I've been researching the net and came up with references to the following technologies:</p>
  
  <ul>
  <li>shared memory </li>
  <li>pipes</li>
  <li>queues</li>
  <li>as well as what's referred as DMA (Direct Memory Access)</li>
  </ul>
  
  <p>but I couldn't find proper analysis of their respective performances, neither how to implement them in both JAVA and C/C++ (so that they can talk to each other), except maybe pipes that I could imagine how to do.</p>
  
  <p>can anyone comment about performances &amp; feasibility of each method in this context ?
  any pointer / link to useful implementation information ? </p>
  
  <hr>
  
  <p>EDIT / UPDATE</p>
  
  <p>following the comment &amp; answers I got here, I found info about Unix Domain Sockets, which seem to be built just over pipes, and would save me the whole TCP stack.
  it's platform specific, so I plan on testing it with JNI or either <a href="http://code.google.com/p/juds/" rel="noreferrer">juds</a> or <a href="http://code.google.com/p/junixsocket/" rel="noreferrer">junixsocket</a>.</p>
  
  <p>next possible steps would be direct implementation of pipes, then shared memory, although I've been warned of the extra level of complexity...</p>
  
  <hr>
  
  <p>thanks for your help</p>