Firstly, which version of Lucene.NET are you using? if 2.9.0, it hasn't been
thoroughly tested yet.

Secondly, you don't have to use any synchronization mechanism, since
Lucene.NET is thread-safe. So you can share the same instance of IndexWriter
or IndexSearcher among threads. Using a write-lock, it also hinders a second
IndexWriter instance to be opened with the same index.

DIGY

-----Original Message-----
From: Li Bing [mailto:lbl...@gmail.com] 
Sent: Thursday, October 29, 2009 7:57 AM
To: lucene-net-user@incubator.apache.org
Cc: Li Bing - Gmail
Subject: Exceptions When Indexing with Multi-threading

Dear all,

Today I got exceptions when indexing with multi-threading. It says
that "deletable.new" or "segments.new" are accessed by other
processes. So it cannot rename ...

However, I have used "ReaderWriterSlim" lock to avoid the relevant
folders to be accessed by multiple threads at the same time. For
example, if the indexing is done in D:\Test\, I use "ReaderWriterSlim"
to prevent other threads from writing in the folder. I think the above
exceptions should not happen if I do that. However, it is NOT true.
Why?

Any other ways to avoid the problem?

Thanks so much!
LB

Reply via email to