lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Multiple threads searching in Lucene and the synchronized issue. -- solution attached.
Date Wed, 10 May 2006 04:16:58 GMT

: > 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 :-)

More specificly, this is functionally half way between example labeled
'Broken multithreaded version' and the example labeled '(Still) Broken
multithreaded version'

An optimizing compiler can freely optimize away the m_indexTerms variable
so the new readIndex function directly modifies this.indexTerms, and the
JVM can allocate RAM for the array and set the variable to point at this
RAM before the array is fully populated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message