RFR: 8284638: store skip buffers in InputStream Object [v7]

liach duke at openjdk.java.net
Tue Apr 19 18:51:26 UTC 2022


On Tue, 19 Apr 2022 18:04:03 GMT, XenoAmess <duke at 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


More information about the core-libs-dev mailing list