lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: [jira] Commented: (LUCENE-690) LazyField use of IndexInput not thread safe
Date Thu, 19 Oct 2006 20:38:36 GMT
On 10/19/06, Ning Li <> wrote:
> > I don't think that's sufficient in part because the IndexInput's state is manipulated
outside that sync block.  The sync block is to protect the file only, not the IndexInput,
which isn't thread-safe (by design).
> Correct, that sync block only protects the file. It and the rest of
> FSIndexInput makes FSIndexInput thread-safe.

FSIndexInput isn't thread safe (by design).  It's clone() method isn't either.

> Not copying the buffer content (nor buffer states) in
> BufferedIndexInput will make BufferedIndexInput thread-safe. But how
> much will this affect performance?

Not carrying over the state breaks the invariant promized by
IndexInput.clone() though:

   * <p>Clones of a stream access the same data, and are positioned at the same
   * point as the stream they were cloned from.

-Yonik Solr, the open-source Lucene search server

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

View raw message