[zeromq-dev] Use of zeromq within a machine

Martin Sustrik sustrik at fastmq.com
Tue Jun 2 08:43:19 CEST 2009


Hi Bill,

> I wonder if anyone can provide results or pointers on use of zeromq 
> within a single multicore machine?
> I currently am building some code that uses zeromq between machines but 
> it is inevitable that some of my processes will be colocated on the same 
> multicore machine. Ideally, I'd have as little knowledge of this as 
> possible and just treat everything as messaging.

You can use 0MQ via loopback interface, however, if you are striving for 
best possible performance I would suggest making each application a 
thread within a single process. 0MQ communication between threads has 
the same API as inter-machine communication and it is much faster than 
standard inter-thread communication via mutexes and al. It uses 
lock-free algorithms, zero-copy (even for one-to-many messaging) 
extremely conservative memory allocation etc.

> How does zeromq compare, in efficiency/performance, to more typical 
> shared memory programming techniques? Or indeed hackery with 
> splice/tee/vmsplice?

There's no shared-memory or splice transport at the moment. It would be 
a nice to have feature however. If there's anyone who would like to 
contribute to adding this kind of functionality out there the 
contributions are most welcome!

Hope this helps.
Martin



More information about the zeromq-dev mailing list