RFR: 8254078: DataOutputStream is very slow post-disabling of Biased Locking [v2]

Andrew Haley aph at openjdk.java.net
Wed Oct 7 17:26:27 UTC 2020


On Wed, 7 Oct 2020 15:27:00 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>>> It might be helpful to add a statement to the DataOutputStream class description to say that it not safe for by
>>> concurrent threads and it needs appropriate synchronization to coordinate multiple writers. This issue or another issue
>>> doesn't matter.
>> 
>> I see.
>> 
>>> Can the benchmark be turned into a microbenchmark for test/micro?
>> 
>> Now there's an interesting question. I can tweak the benchmark (which at present contains a modified version of
>> DataOutputSteam, so can compare and contrast) so that it measures only the performance of the core library's
>> implementation. Does that make sense? If so, I can add it to this PR.
>
> The benchmark can be run with different JDKs, so the modified DOS can be omitted.

It turns out that DataInputStream already has a comment about thread safety being the user's problem, so I copied that
comment to DataOutputStream.

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

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


More information about the core-libs-dev mailing list