On 10/19/06, Ning Li <[EMAIL PROTECTED]> 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
http://incubator.apache.org/solr Solr, the open-source Lucene search server
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]