[zeromq-dev] inproc: passing pointer VS zero-copy VS regular send?
Pieter Hintjens
ph at imatix.com
Tue May 14 23:21:48 CEST 2013
You can pass pointers within one process over inproc and that works
but you introduce timing dependencies on when data can be safely
destroyed. Also you cannot scale out of process.
On Sun, May 12, 2013 at 11:01 PM, Oleg Vazhnev <ovazhnev at gmail.com> wrote:
>
> Thanks Pieter!
>
> Why not passing pointers around? What possible problems can I face?
>
> So far I decided to just pass pointer because it's fast and easy at the
> same time. I don't need serialize/deserialize data, only "unsafe" code
> block on c# side (i don't implemented that yet).
>
> Assuming that subscriber is fast enough and buffer is big enough i don't
> see any problems with passing pointer. I'm using ring-buffer and do not
> allocate anything at runtime.
>
> Thanks,
> Oleg
>
> 12.05.2013 20:54, Pieter Hintjens пишет:
>> Hi Oleg,
>>
>> Some general advice:
>>
>> - don't optimize code until you need to, measure before and after.
>> - zero copy is not useful on small messages
>> - don't pass pointers around
>> - read the Guide and learn by making simple designs first
>> - again, don't optimize or try to make designs faster until you really need to
>>
>> -Pieter
>>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list