[nanomsg] Re: When is it safe to use NN_MSG?

  • From: Stefan de Konink <stefan@xxxxxxxxx>
  • To: <nanomsg@xxxxxxxxxxxxx>
  • Date: Fri, 27 Dec 2013 15:22:13 +0100

On Friday, December 27, 2013 2:45:08 PM CEST, Martin Sustrik wrote:
It's just an implementation detail. The messages are passed down the
stack as simple chunks of memory. Thus, nn_sendmsg concatenates the
iovecs into a single chunk of memory and passes that further.

However, NN_MSG is supposed to provide zero-copy functionality, thus
copying it into a single memory chunk with other iovecs is not an option.

That being said, the library can be improved to pass a *list* of
memory chunks down the stack. It wouldn't be hard to implement, but
would require a lot of work (in terms of LoC).

I would suggest to document this, because this is the answer to the question in 
the subject.

Stefan

Other related posts: