Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 26684 invoked from network); 9 Sep 2009 06:18:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Sep 2009 06:18:22 -0000 Received: (qmail 83900 invoked by uid 500); 9 Sep 2009 06:18:22 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 83838 invoked by uid 500); 9 Sep 2009 06:18:22 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 83829 invoked by uid 99); 9 Sep 2009 06:18:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 06:18:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 06:18:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 89D07234C053 for ; Tue, 8 Sep 2009 23:17:57 -0700 (PDT) Message-ID: <96300931.1252477077563.JavaMail.jira@brutus> Date: Tue, 8 Sep 2009 23:17:57 -0700 (PDT) From: "Regis Xu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-6312) Concurrency problems in NIO In-Reply-To: <686258648.1250542154851.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Regis Xu updated HARMONY-6312: ------------------------------ Attachment: selector.zip I propose patch serial in selector.zip, it is based on current HEAD. This serial of patches keep the selector's way of handling keys, just bug fixing and improvement. 0001-remove-SelectionKeyImpl.hasCode-equals-the-old-impl.patch and 0002-synchronized-on-unmodifiableKeys.patch is from Jesse' patch, very thanks Jesse. 0003-keep-Selector.keysSet-reflect-keys-of-selector-consi.patch fix Selector.keysSet doesn't reflect keys consistently 0004-signal-workaround-for-drlvm.patch is workaround for a known issue of drlvm, thread blocked on io will be interrupted by unrelated signal. This patch make sure test in patch 0005 can be passed. 0005-remove-cancelledKeys-from-selectedKeys.patch and 0006-add-new-interface-accept-read-write-fd-count-to-avoi.patch is from my previous patches on this issue. > 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: Mark Hindess > Attachments: cancelledkey.diff, NIO_Concurrency_issues.patch, selector.zip > > 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.