[zeromq-dev] zmq_msg_* functions don't check for message validity
Pieter Hintjens
ph at imatix.com
Thu Apr 14 17:22:47 CEST 2011
On Mon, Apr 11, 2011 at 11:48 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> The problem with zmq_msg_t is that it's on the critical path. The
> structure itself is very compact and has no space for a runtime tag.
> Also the code dealing with it is highly optimised and presumably should
> not do any additonal memory access operations.
Two bytes for a tag does not seem significant.
Also, is checking for sockets (which no-one actually asked for) not on
the same critical path?
> However, if there's strong need for this kind of functionality, we can
> allow it to be switched on at the compile time, say when --enable-debug
> is used.
I'd say the need for checking on messages is stronger than on sockets
and contexts, since the API for messages is more complex and easier to
get wrong.
Switching it on and off is fine but the default should be 'on' IMO.
-Pieter
More information about the zeromq-dev
mailing list