[zeromq-dev] [PATCH] Commands are now stored in ypipes instead of socketpairs

Martin Sustrik sustrik at 250bpm.com
Sun Jul 3 16:01:14 CEST 2011


Hi Martin,

> wouldn't a MPSC queue work better (read faster) than a ypipe protected
> with a mutex?
>
> e.g.:
> http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue

The problem, AFAICS, is that mpsc stored atomic objects, 32 or 64 bits 
depending on platform.

Thus it can't store command_t as such. It would have to store a pointer 
instead, which in turn means the command_t object would have to be 
allocated on heap.

In general, doing mutex lock/unlock is faster than doing malloc/free and 
that's why I doubt mpsc would result in any performance improvement.

Martin



More information about the zeromq-dev mailing list