commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (IO-201) CountingInputStream/CountingOutputStream only partially synchronized
Date Wed, 04 Aug 2010 21:18:16 GMT

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

Niall Pemberton updated IO-201:
-------------------------------

    Fix Version/s: 2.x

The resetCount method was added with the synchronized keyword:
    * https://svn.apache.org/viewvc?view=revision&revision=140583

The getCount() methods were synchronzied later for the changes IO-84 - but theres no mention
of why
    * https://svn.apache.org/viewvc?view=revision&revision=462818

I agree the syncronization is incomplete and could probably be removed. Seems like a minor
thing though so. I'm assigning this to 2.x.

> CountingInputStream/CountingOutputStream only partially synchronized
> --------------------------------------------------------------------
>
>                 Key: IO-201
>                 URL: https://issues.apache.org/jira/browse/IO-201
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Filters
>    Affects Versions: 1.4
>            Reporter: Sebb
>             Fix For: 2.x
>
>
> CountingInputStream is only partially synchronized.
> The count is not synchronized when it is updated in read operations, so is not guaranteed
to be published correctly
> The synchronization could be removed without loss of functionality.
> Not sure it makes sense to share a stream between threads anyway, as the underlying stream
is unlikely to be thread-safe.
> If only one thread reads the stream, then the count field could be made volatile.
> This would allow other threads to read the count safely.

-- 
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