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

Brian Burkhalter bpb at openjdk.org
Thu Dec 15 17:12:12 UTC 2022


On Thu, 15 Dec 2022 15:01:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Improve benchmarks
>>  - Add benchmark
>>  - Use Bits instead of custom code
>
> src/java.base/share/classes/java/io/RandomAccessFile.java line 60:
> 
>> 58:  * {@code IOException} may be thrown if the stream has been closed.
>> 59:  *
>> 60:  * @implNote This class is not thread safe.
> 
> I don't think this should be an implNote. Maybe for a different issue/PR is that the class description probably needs a paragraph to say that a RAF is not thread safe and requires appropriate synchronization when used by concurrent threads. This leads to discussion about a FileChannel obtained from a RAF as FileChannel defines read/write methods that support cases where threads need to access different parts of a file at the same time. There is a lot more to say on this topic and probably best to keep it separate.

Nit: Also I think it needs hyphenation: `thread-safe`.

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

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


More information about the core-libs-dev mailing list