Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4097272
Votes 3
Synopsis Add unsynchronized versions of buffered byte and character streams
Category java:classes_io
Reported Against 1.1 , 1.0fcs
Release Fixed
State 11-Closed, Will Not Fix, request for enhancement
Priority: 4-Low
Related Bugs 1244425
Submit Date 05-DEC-1997
Description
Add unsynchronized versions of the following classes:

    BufferedInputStream
    BufferedOutputStream
    BufferedReader
    BufferedWriter

Many Java developers are already in the habit of copying our buffered-stream
classes and then removing the synchronized keywords.  Perhaps we should just
make this part of the core I/O library.
Work Around
N/A
Evaluation
In the past, it is possible that removal of synchronization from these classes would result in performance improvements in scenarios where the synchonization is unnecessary (e.g. single threaded applications).  However, in jdk6 many VM optimizations were made around locking.  In particular, in a single-threaded scenario the VM will elide locks thus making the performance impact of unnecessary synchronization negligible.  Therefore, the only benefit of having unsynchronized versions of these classes would be for applications that handle their own synchronization.  Since there is no evidence that this is a common scenario there is no reason to introduce these new classes for this purpose at this time.  Closing this issue as "will not fix".
Posted Date : 2007-03-20 03:41:38.0
Comments
  
  Include a link with my name & email   

Submitted On 22-NOV-2000
kW
This bug will get 3 (three) years old in about two weeks and still is not fixed. You can read
about it's global impact (3% global speed for example in one application) in this paper I found: 
http://www.cs.umd.edu/~pugh/IsCodeOptimizationRelevant.pdf

In JDK1.3, it seems to be fixed for BufferedReader and BufferedWriter, but not for BufferedInputStream
and BufferedOutputStream.

Maybe you did not change BufferedOutputStream and BufferedInputStream in order to not break legacy
applications, but note that relying in the source code is wrong, relying on the API docs is right and because
there is nothing about synchronized BufferedOutputStreams in the API docs, BufferedOutputStreams should
not be synchronized because synchronizing without a requirement (and without docs) can be a performance 
penalty and a source of deadlocks.


Submitted On 11-OCT-2005
smithk10
any movement on this in the last EIGHT years?

"in progress"... ha

crazy.



PLEASE NOTE: JDK6 is formerly known as Project Mustang