Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 17629 invoked from network); 28 Nov 2010 08:12:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Nov 2010 08:12:03 -0000 Received: (qmail 48996 invoked by uid 500); 28 Nov 2010 08:12:02 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 48736 invoked by uid 500); 28 Nov 2010 08:12:02 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 48729 invoked by uid 99); 28 Nov 2010 08:12:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Nov 2010 08:12:01 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Nov 2010 08:11:59 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAS8BbZo021801 for ; Sun, 28 Nov 2010 08:11:37 GMT Message-ID: <31571163.4971290931897457.JavaMail.jira@thor> Date: Sun, 28 Nov 2010 03:11:37 -0500 (EST) From: "Earwin Burrfoot (JIRA)" To: dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2779) Use ReadWriteLock in RAMDirectory In-Reply-To: <10750696.314731290706214515.JavaMail.jira@thor> 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/LUCENE-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964511#action_12964511 ] Earwin Burrfoot commented on LUCENE-2779: ----------------------------------------- If you don't write, you don't care about locking in RAMDir at all. Your reader opens files once, and then never ever does it again. Believe me, this is so pointless. > Use ReadWriteLock in RAMDirectory > --------------------------------- > > Key: LUCENE-2779 > URL: https://issues.apache.org/jira/browse/LUCENE-2779 > Project: Lucene - Java > Issue Type: Improvement > Components: Store > Reporter: Shai Erera > Assignee: Shai Erera > Priority: Minor > Fix For: 3.1, 4.0 > > > RAMDirectory synchronizes on its instance in many places to protect access to map of RAMFiles, in addition to updating the sizeInBytes member. In many places the sync is done for 'read' purposes, while only in few places we need 'write' access. So I think ReadWriteLock can be useful. > Also, syncing around sizeInBytes is unnecessary IMO, since it's an AtomicLong ... > I'll post a patch shortly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org