On Wed, 13 Nov 2024 03:11:41 GMT, Chen Liang <li...@openjdk.org> wrote:

>> Uses of `InternalLock` are removed and `synchronized` is reinstated.
>
> 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.

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

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

Reply via email to