[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zeromq-dev
Subject:    Re: [zeromq-dev] How to do zero-copy multi-part messages without transfering the ownership of the da
From:       lists () chuckremes ! com
Date:       2017-03-28 13:18:33
Message-ID: 32BE66B4-EFAF-4515-B76F-DB315775EE42 () chuckremes ! com
[Download RAW message or body]

> On Mar 28, 2017, at 7:57 AM, Stephan Opfer <opfer@vs.uni-kassel.de> wrote:
> 
> Hi,
> 
> I would like to do what is described in this tutorial here: \
> http://zeromq.org/blog:zero-copy 
> But, I don't like to transfer the ownership to ZMQ, because it will delete the data \
> when the message is sent. 
> My application is more like this:
> 
> Several autonomous robots inform each other from each other from time to time about \
> the results of some calculuations, e.g., path planning results. 
> These results are created for further processing and need to be kept in the \
> ownership of the process itself. They can be send with zero-copy, because the wont \
> be altered anymore, but should not be deleted. 
> Any suggestions?

I would suggest passing a delete function to zeromq that is a no-op or just sets a \
flag that your process can retrieve. There is no real "transfer of ownership" \
happening within the library. The transfer that the documentation talks about is the \
*responsibility* to free the memory buffer once it has been sent by zeromq.

If your robot processes need to continue owning the buffer then just pass a function \
to zeromq that, when called, will set a flag in your robot process that indicates \
zeromq has finished with the buffer. Then your library can reuse the memory, \
deallocate it, or whatever. _______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic