harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5635) [classlib][luni][performance] ObjectInputStream should empty the underlying stream in right way
Date Thu, 17 Apr 2008 12:49:24 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aleksey Shipilev updated HARMONY-5635:
--------------------------------------

    Issue Type: Sub-task  (was: Improvement)
        Parent: HARMONY-5632

> [classlib][luni][performance] ObjectInputStream should empty the underlying stream in
right way
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5635
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5635
>             Project: Harmony
>          Issue Type: Sub-task
>            Reporter: Aleksey Shipilev
>            Assignee: Tim Ellison
>         Attachments: 0003-serial-emptystream.patch
>
>
> For now, ObjectInputStream empties the underlying stream by assigning it to static emptyStream
instance.
> This is very buggy way to do things, for two reasons:
>  1. Consider you've done
>          ByteArrayInputStream temp1 = emptyStream;
>      then you might do temp1.write(...) and spoil the emptyStream with garbage. Luckily
there are no such opportunities in current OIS.
>  2. Consider you've "emptied" several streams in different threads and then ask for OIS.available()
then you would have the BAIS.available() [synchronized by spec] - and the _contention_, up
to fat monitors invocation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message