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

Alan Bateman alanb at openjdk.java.net
Thu Oct 8 06:54:49 UTC 2020


On Wed, 7 Oct 2020 18:56:57 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8254078: DataOutputStream is very slow post-disabling of Biased Locking
>
> src/java.base/share/classes/java/io/DataOutputStream.java line 36:
> 
>> 34:  * Thread safety is optional and is the responsibility of users of
>> 35:  * methods in this class.
>> 36:  *
> 
> In -> Out copy/paste

I realise this is wording coming from DataInputStream but I don't think specifying the thread safety as optional is
useful. What would you think about using something like this (and changing DataInputStream too):

"A DataOutputStream is not safe for use by multiple concurrent threads. If a DataOutputStream is to be used by more
than one thread then access to the data output stream should be controlled by appropriate synchronization."

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

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


More information about the core-libs-dev mailing list