[zeromq-dev] zmsg.hpp

Pieter Hintjens ph at imatix.com
Thu Apr 28 16:42:07 CEST 2011


On Thu, Apr 28, 2011 at 4:32 PM, Ilja Golshtein <ilejncs at narod.ru> wrote:

> zmsg.hpp is used in "Simple Pirate queue" C++ example. The wrap/unwrap semantics was unclear
> for me and I've tried to find out the roots.

It's a user-contributed translation. Afair there was some confusion at
the time on how best to do this.

> Personally I believe 0mq is targeted at people and environments do care about
> performance and things like extra copy. That is why slow wrappers are a sort of dangerous
> and could occasionally ruin 0mq reputation.

The goal should be, IMO, to define good abstractions and then make
them faster over time. For example the zmsg abstraction (1 message =
0..N frames) is a good abstraction that can be done cheaply first, and
improved later. By placing the actual 0MQ recv/send code in one place
it's possible to add zero-copy to an entire application in one go.

So there's no conflict between wrappers and performance and if done
right, wrappers give you better performance because of the leverage.

It's also really nice to be able to (e.g.) switch between 2.1 and 3.0
without changing your code. So I'd really advocate a cppzmq layer, but
I'm not competent to make it.

-Pieter



More information about the zeromq-dev mailing list