RFR: 8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier [v2]
Alan Bateman
alanb at openjdk.org
Tue Apr 23 07:29:28 UTC 2024
On Tue, 23 Apr 2024 07:11:34 GMT, Viktor Klang <vklang at openjdk.org> wrote:
> Has the alternative of moving to a j.u.c.Lock (Needs Reentrant or not?) been explored/benchmarked?
Yes, decided not to do because it's just guarding access to a byte[] and any changes can influence the inlining. Plus, it would need to continue to use monitors when extended as the subclass may assume synchronization in the super class. Limiting it to just the problematic writeTo method seem the least risky.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18901#issuecomment-2071613230
More information about the core-libs-dev
mailing list