RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]

Alan Bateman alanb at openjdk.org
Tue Dec 13 19:59:57 UTC 2022


On Tue, 13 Dec 2022 09:27:24 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR suggests improving performance for read and write operations for the longer primitives in `RandomAccessFile`.
>> 
>> These improvements would also propagate to other JDK classes relying on these improved `RandomAccessFile` operations.
>
> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
> 
>  - Merge master
>  - Perform I/O operations in bulk for RandomAccessFile

> As far as I understand #10031 was closed because there we doubts about whether it's safe to use shared array within multiple methods. Here we use the same approach.

I think that PR was closed as it went inactive but I think where you got to is very similar to what Per's change is now.

RandomAccessFile doesn't specify it but it can't be used from several threads without external synchronization. This is because it maintains a file position that is updated when reading and writing, or it can be changed when seeking to positions in the file. So on the surface, the byte[] should be okay.

-------------

PR: https://git.openjdk.org/jdk/pull/11644


More information about the core-libs-dev mailing list