harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6312) Concurrency problems in NIO
Date Mon, 28 Sep 2009 08:58:16 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760192#action_12760192

Regis Xu commented on HARMONY-6312:


In my understanding, SelectorBenchmark.java try to simulate a "real" scenario of using selector,
so I picked benchmark from HARMONY-4879 which *only* test Selector.selectNow(), the result:

svn + no mapping
clients/active per    100      10
100                  1318    1102
500                  8325    7612
1000                20083   18235
1500                33486   29643

clients/active per     100      10
100                    924     643
500                   6465    5206
1000                 16494   12250
1500                 28537   20684

the gap is obvious. While micro benchmark just said a side of words, we would like that it
could work better in real world, I may need more time to do more test.

> The change to OSNetworkSystemLinux doesn't appear to honor the timeout properly
Yes, we need to find a better way to resolve this issue.

> I don't see reason to keep the previous select() method. 
I'd like the old one to call the new one, so other places depend on old interface can work
without modifications.

> I found processing a .zip of git patches quite cumbersome to work with.
I just think small patches are easy to review, because one patch only do one simple thing.
What form of patches do you prefer? I think git can help me to do that :)

> Concurrency problems in NIO
> ---------------------------
>                 Key: HARMONY-6312
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6312
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: SVN Revision: 801399
>            Reporter: Jesse Wilson
>            Assignee: Regis Xu
>         Attachments: cancelledkey.diff, harmony_svn.html, harmony_svn_plus_patch_2009-08-19.html,
NIO_Concurrency_issues.patch, ri.html, selector.zip, SelectorBenchmark.java
>   Original Estimate: 72h
>  Remaining Estimate: 72h
> There's several potential concurrency problems in our NIO implementation...
>  - Charset#isSupported isn't synchronized, but it accesses mutable member cachedCharsetTable.
>  - In SelectionKeyImpl, stHash++ is a non-atomic operation so multiple SelectionKey instances
may receive the same hash code. (Why not use the default hash code?)
>  - In SelectorImpl, the unmodifiableKeys member is never synchronized on. But the documentation
specifies that clients can synchronize on that set to guard against changes
> These are the obvious problems; I suspect there are more subtle concurrency defects at
play here. I'll prepare a patch to address the major issues, and we should consider a rigorous
approach (Findbugs?) to discover concurrency problems.
> #Android

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

View raw message