RFR: 8219014: (bf) Add absolute bulk put methods which accept a source Buffer

Alan Bateman Alan.Bateman at oracle.com
Mon Nov 2 16:14:39 UTC 2020


On 02/11/2020 15:24, Martin Thompson wrote:
> On Fri, 30 Oct 2020 20:37:53 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>
>> Please review this proposed fix. The previous incarnation of this review was most recently in mail threads [1, 2] under the old Hg SCM. The implementation changes proposed here are derived from the final (.02) patch posted in [1]. The corresponding CSR is [3].
>>
>> The essence of the change is to move the bulk put buffer core functionality to a new method putBuffer(), modify the existing relative bulk put buffer method to call it, and add a new absolute bulk put buffer method which also calls it. The existing test for bulk put buffer functionality is modified to verify the new API.
>>
>> This change builds on the work completed for JDK-5029431 (bulk put and get using an array) and JDK-8245121 (relative bulk put buffer with overlapping regions).
>>
>> [1] http://mail.openjdk.java.net/pipermail/nio-dev/2020-June/007340.html
>> [2] http://mail.openjdk.java.net/pipermail/nio-dev/2020-July/007344.html
>> [3] https://bugs.openjdk.java.net/browse/JDK-8248431
> The other method implementations which do a absolute put or get do not modify the position. This makes them more useful in a multi-threaded context as different threads can be updating different ranges of the buffer concurrently. To replace Unsafe we need absolute index methods that do not update position.
>
These methods are absolute bulk operations, the index of both the source 
and receiver are specified.

The Foreign Memory Access API, in development in Project Panama, may be 
more appropriate for replacing code that is using Unsafe for off-heap 
memory.

-Alan


More information about the nio-dev mailing list