[zeromq-dev] Memory management

Auer, Jens jens.auer at cgi.com
Thu Apr 14 13:08:32 CEST 2016


Hi,

there is zmq_msg_init_data which gets a callback which is called when the message is released. However, it is not fully zero-copy because some copying is done when receiving messages. With 4.2, this is reduced, but until that, the data is received into a fixed buffer and then copied into the message.

That all reminds me that I wanted to add the possibility to use custom allocator functions to be able to use a memory pool. I think it should be possible, e.g. by setting function pointers as zmq context options, plus void* hint that can be set too.

Cheers,
  Jens

--
Jens Auer | CGI | Software-Engineer
CGI (Germany) GmbH & Co. KG
Rheinstraße 95 | 64295 Darmstadt | Germany
T: +49 6151 36860 154
jens.auer at cgi.com<mailto:jens.auer at cgi.com>
Unsere Pflichtangaben gemäß § 35a GmbHG / §§ 161, 125a HGB finden Sie unter de.cgi.com/pflichtangaben<http://de.cgi.com/pflichtangaben>.

CONFIDENTIALITY NOTICE: Proprietary/Confidential information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply e-mail.
________________________________
Von: zeromq-dev-bounces at lists.zeromq.org [zeromq-dev-bounces at lists.zeromq.org]" im Auftrag von "Jeff Shanab [jshanab at jfs-tech.com]
Gesendet: Donnerstag, 14. April 2016 12:06
An: ZeroMQ development list
Betreff: [zeromq-dev] Memory management

I am writing an app in C++ and using libzmq directly, not much of the c++ wrapper stuff.

I am interested in zero copy or at least minimizing the number of copies of large buffers.

But am running across an all too common issue, Each library used wants to have their own memory management forcing me to copy between the systems.

Is there a way I could use boost shared_ptr<zmq_msg_t> with the functions so ZMQ could dereference/delete after the send?

In fact is there a way to hook into the system and get a callback when it goes to delete with the client pointer so I can delete or return it to a pool?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160414/4c33e326/attachment.htm>


More information about the zeromq-dev mailing list