On Tue, 19 Apr 2022 18:04:03 GMT, XenoAmess <d...@openjdk.java.net> wrote:

> Reader uses a lock object and it appears that InputStream locks on this (per 
> make/reset) I would assume now that you have some object member fields you 
> need to hold some lock while accessing those. Even though single thread 
> access would be the expected case.

Locks are expensive. We just use buffers that may or may not be shared by 
different threads (for the java memory model), because locking objects is too 
costly performance-wise.


PR: https://git.openjdk.java.net/jdk/pull/5872

Reply via email to