On Tue, 2017-08-29 at 12:38 +0200, Stephan Opfer wrote:
> Hi Luca,
> 
> the reason for me to use multi-part messages is, that I have the
> content of a message already in memory, but not in one continues
> memory sequence. So if I want to achieve zero-copy, I need to compose
> the message from several memory locations, that should not be copied.
> 
> When I understand you right, I just need to send several messages
> (one for each memory location)?
> 
> I think, that this would break my attempt to use Cap'n Proto
> (de)serialization. At least it could be tricky to recompose the Cap'n
> Proto message on the receiving side.
> 
> My current workflow contained the following step:
> 
> 1. Compose the Cap'n Proto message by let the message pointing to the
> different parts / memory locations.
> 
> 2. Send the different parts of the Cap'n Proto message as multi-part
> message via ZMQ + UDP + Multicast.
> 
> 3. Receive the Multi-Part message and reconstruct a Cap'n Proto
> message from it.
> 
> Instead step 3. now would need to receive several messages (incl.
> handling missing messages) in order to recreate the Cap'n Proto
> message.
> 
> My think that zero-copy isn't worth the hassle, in that case. So
> instead I tend to copy everything into one continuous memory sequence
> and send it as one message, which would just mean that I can compose
> the Cap'n Proto message without taking care of zero-copy.
> 
> Any thoughts?
> 
> Greetings,
>    Stephan

Note that multi-part does _not_ imply contiguous memory location on the
receive end (it might happen but there's no guarantee anywhere). So if
that's a requirement for your use case, then you need to use a single
message anyway.

-- 
Kind regards,
Luca Boccassi

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to