RFR: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io [v3]

Chen Liang liach at openjdk.org
Wed Nov 13 19:45:21 UTC 2024


On Wed, 13 Nov 2024 07:15:15 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/java.base/share/classes/java/io/BufferedOutputStream.java line 88:
>> 
>>> 86:         }
>>> 87: 
>>> 88:         this.buf = new byte[initialSize]; // resizable if initialSize < maxSize
>> 
>> Same remark as for BIS.
>> 
>> Also this initial vs max size feature was added when virtual thread was first implemented as the internal locks.  Is this implementation detail still necessary for the virtual threads?
>
> Think about 100_000 virtual threads, all blocked on sockets with input/output streams that have wrapped with buffered streams, as in BIS and BOS. This is the motivation for using a reduced initial size.

Suggestion:


Seems you forgot to remove this line after restoring the if-else below.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22048#discussion_r1841061978


More information about the core-libs-dev mailing list