[zeromq-dev] how to receive a message into a static buffer?
Aamir M
intuitionist at gmail.com
Mon May 4 17:39:40 CEST 2009
I see the problem. What if the user supplies a fixed-length buffer at the
time of queue creation and 0MQ refuses to asynchronously retrieve data from
the network until buffer space becomes available? The user would have to
indicate when it done with each message so that 0MQ knows which buffers are
available.
The reason I'm so concerned about this is that I'm using 0MQ for
process-scope messaging between threads ... So 0MQ does one copy to move the
message between the threads, but then I must do a second copy to place the
data in my static buffer ... I may be wrong, but that sounds like one too
many memcopies for just communicating between two threads.
On Mon, May 4, 2009 at 10:56 AM, Martin Sustrik <sustrik at fastmq.com> wrote:
> Aamir M wrote:
>
>> Hi Martin,
>>
>> Is the concept of a user-provided receive buffer completely out of the
>> question? What if the user provided 0MQ with a buffer and promised not to
>> touch the buffer until it gets a pointer from 'receive'? Couldn't the copy
>> be eliminated in this way? I think this would be a very useful feature for
>> high performance streaming.
>>
>
> The problem remains: The data can be retrieved from the network even before
> you supply the buffer. I don't see any way how to get around that. Any
> ideas?
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090504/cb18c28a/attachment.htm>
More information about the zeromq-dev
mailing list