Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 13390 invoked from network); 2 Mar 2010 02:39:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Mar 2010 02:39:24 -0000 Received: (qmail 60985 invoked by uid 500); 2 Mar 2010 02:39:20 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 60912 invoked by uid 500); 2 Mar 2010 02:39:20 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 60903 invoked by uid 99); 2 Mar 2010 02:39:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 02:39:20 +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; Tue, 02 Mar 2010 02:39:17 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id BF147234C4A8; Tue, 2 Mar 2010 02:38:56 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 48791] Race condition in class javax.el.BeanELResolver$BeanProperty field read/write X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 6 X-Bugzilla-Component: Servlet & JSP API X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: qiyaoltc@gmail.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: default X-Bugzilla-Changed-Fields: CC In-Reply-To: References: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Message-Id: <20100302023856.BF147234C4A8@brutus.apache.org> Date: Tue, 2 Mar 2010 02:38:56 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=48791 Yao Qi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |qiyaoltc@gmail.com --- Comment #2 from Yao Qi 2010-03-02 02:38:55 UTC --- (In reply to comment #1) > It might be inefficient (although I doubt you'd notice it in any realistic > test), it might be poor coding style (that is arguable) but it isn't a bug. Can you explain a little bit why it isn't a bug? If two threads access the following code, 255 private Method read(ELContext ctx) { 256 if (this.read == null) { 257 this.read = getMethod(this.owner,descriptor.getReadMethod()); The value of this.read will be either return value of getMethod invoked by two threads. Can we change it to this manner, if (this.read == null) { synchronized (lock4Read){ if (this.read == null){ this.read = getMethod(this.owner,descriptor.getReadMethod()); } } This change is still efficient, and make sure no race in it. How do you think? -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org