lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yueyu lin" <popeye...@gmail.com>
Subject Re: Multiple threads searching in Lucene and the synchronized issue. -- solution attached.
Date Wed, 10 May 2006 06:00:55 GMT
I understand that. Thanks for all.
I will still use the original Lucene jar and will continue to dig Lucene.
Wish I would find something useful for all of you.
:)


On 5/10/06, Chris Hostetter <hossman_lucene@fucit.org> wrote:
>
>
> : I think you could use a volatile primitive boolean to control whether or
> not
> : the index needs to be read, and also mark the index data volatile and it
> : SHOULD PROBABLY work.
> :
> : But as stated, I don't think the performance difference is worth it.
>
> My understanding is:
>   1) volatile will only help as of java 1.5 ... lucene targets 1.4
>      compatibility.
>   2) in 1.5, volatile is basically just as expensive as synchronized.
>
> : 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,
> it
> : seems ok.
> : Whether it will break in other environments, I still don't know about
> it.
>
> The dangerous thing is that even if the byte code looks okay, and if it
> works okay today, your app could run for a while and then all of the
> sudden it could stop working because of the order the threads are run, or
> becuase of an optimization the JVM applies on the fly.
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>


--
--
Yueyu Lin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message