[zeromq-dev] ByteBuffer API for JZMQ
Joel Lauener
Joel.Lauener at cern.ch
Tue May 14 12:11:01 CEST 2013
Hi Trevor,
What is the purpose of int recvByteBuffer(int flags) ?
Will this be a true 0 copy implementation? Or will the buffer still be copied within the send/receive call? I guess the latest because as far as I understand there is no way to pass ownership of data between Java and Native code.
I'm already looking forward to performance measurement. This looks interesting.
Message: 3
Date: Mon, 13 May 2013 13:58:32 -0300
From: Trevor Bernard <trevor.bernard at gmail.com>
Subject: [zeromq-dev] ByteBuffer API for JZMQ
To: ZeroMQ development list <zeromq-dev at lists.zeromq.org>
Message-ID:
<CAGGWQ++Ebrx2TX7TU2wo_Vb6JJ0gWwbTD-TKSwxy=iio-VEEDw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
In the next couple of days I will be writing a ByteByffer API for JZMQ I would like to hear the communities thoughts.
I was thinking of something along the lines of:
int sendByteBuffer(ByteBuffer bb, int flags); int recvByteBuffer(ByteBuffer bb, int flags); int recvByteBuffer(int flags);
Implementation seems straightforward enough. Though it really only makes sense to use a Direct ByteBuffer since it's allocated off the heap and can be passed to libzmq without a copy. Otherwise you'd have to copy the underlying byte[].
So does it make sense to only support a direct bytebuffer?
Thoughts?
-Trev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130513/5e08ddaa/attachment-0001.htm
More information about the zeromq-dev
mailing list