[zeromq-dev] IPC (again)

Jon Dyte jon at totient.co.uk
Thu Dec 31 12:33:45 CET 2009


On Wednesday 30 Dec 2009, Erik Rigtorp wrote:
> Hi!
> 
> I've read the two discussions on using ZeroMQ for IPC. I think ZeroMQ
> should support IPC and in-process communication.
> 
I think we all agree on this.

> TCP is nice to work with but it has one problem: On linux (and others)
> TCP over loopback doesn't bypass the TCP stack which makes the latency
> several times higher than using pipes or unix domain sockets. I know
> that on Solaris this is optimized so that a loopback TCP connection

is that since a particular solaris release 8,9,10?
I havent got my solaris internals book to hand right now ;-)

> becomes more or less a pipe. For low latency IPC on Linux ZeroMQ needs
> pipes or unix domain sockets.
> 
just before xmas I exchanged an email with Martin about providing a fifo/pipe 
interface. (I wasnt concerned about performance, but wanted a zmq socket 
connection that could only be accessed via the same machine and not via 
loopback.) Subsequently I think that providing AF_LOCAL (AF_UNIX) sockets 
would be a good idea.

> For ultra low latency IPC there is only one way to go and that is to
> use shared memory. I took a look at yqueue.hpp in zeromq2 and it's a
> good start. We only need to add a lock free memory allocator (which

I'm glad some one else has looked at this because a while back I wondered 
whether the yqueue.hpp could use shared memory.


> can be implemented using a lock free queue) or implement a lock free

ypipe.hpp for example?

> ringbuffer that would hold a fixed number of messages and block the
> writer when it's full. For signaling I suggest to implement two
> different approaches. One using pthreads conditions and one using busy
> waiting. From my own testing I've seen that the pthreads
> implementation would have similar latency as pipes/unix domain sockets
> and a busy waiting solution would achieve latencies <1µs.
> 
> Erik Rigtorp

HNY

Jon


> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 





More information about the zeromq-dev mailing list