Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 30055 invoked from network); 10 May 2006 04:32:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 May 2006 04:32:11 -0000 Received: (qmail 77256 invoked by uid 500); 10 May 2006 04:32:08 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 77226 invoked by uid 500); 10 May 2006 04:32:08 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 77215 invoked by uid 99); 10 May 2006 04:32:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 21:32:08 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of popeyelin@gmail.com designates 64.233.184.230 as permitted sender) Received: from [64.233.184.230] (HELO wr-out-0506.google.com) (64.233.184.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 21:32:07 -0700 Received: by wr-out-0506.google.com with SMTP id i3so75256wra for ; Tue, 09 May 2006 21:31:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=XbAl7ZWkkLvfbODOIUFbh9XYN6ir3U2Ma6OQwBu2hE8UK2k+zub5ZVqovO/ZSJyfGuCKs3lRpMIbzuI9CEk4oojGSrejnYSq3OGtju/lTlruSPf3zaGRuDWHkv/x6zvU8Ni13yZZ1mEiGGi5JL0MmcaKz8exxvPI5cBTCHmJbug= Received: by 10.54.133.19 with SMTP id g19mr256896wrd; Tue, 09 May 2006 21:31:46 -0700 (PDT) Received: by 10.54.81.6 with HTTP; Tue, 9 May 2006 21:31:46 -0700 (PDT) Message-ID: <8e7e4d020605092131t6e272c0bke0b3b3bfc31a4184@mail.gmail.com> Date: Wed, 10 May 2006 12:31:46 +0800 From: "yueyu lin" To: java-dev@lucene.apache.org Subject: Re: Multiple threads searching in Lucene and the synchronized issue. -- solution attached. In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10394_21917138.1147235506874" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_10394_21917138.1147235506874 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I met these problem before indeed.The compiler did something optimized for me that was bad for me when I see the byte-codes. When I'm using a function local variable, m_indexTerms and in JDK1.5.06, i= t seems ok. Whether it will break in other environments, I still don't know about it. On 5/10/06, Yonik Seeley wrote: > > On 5/9/06, Robert Engels wrote: > > I am fairly certain his code is ok, since it rechecks the initialized > state > > in the synchronized block before initializing. > > That "recheck" is why the pattern (or anti-pattern) is called > double-checked locking :-) > > -Yonik > http://incubator.apache.org/solr Solr, the open-source Lucene search > server > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-dev-help@lucene.apache.org > > -- -- Yueyu Lin ------=_Part_10394_21917138.1147235506874--