Re: Exceptions When Indexing with Multi-threading

2009-10-30 Thread Li Bing
ple threads sharing a writer for > performance reasons. > > Michael > > -Original Message- > From: Li Bing [mailto:lbl...@gmail.com] > Sent: Thursday, October 29, 2009 8:02 PM > To: Michael Garski > Cc: lucene-net-user@incubator.apache.org > Subject: Re: Exce

RE: Exceptions When Indexing with Multi-threading

2009-10-29 Thread Michael Garski
arski Cc: lucene-net-user@incubator.apache.org Subject: Re: Exceptions When Indexing with Multi-threading Dear Michael, Yes, each thread in my system has its own IndexWriter. But all of them are synchronized by a unique lock. So I think the exception should not occur, right? If the threads sh

Re: Exceptions When Indexing with Multi-threading

2009-10-29 Thread Li Bing
Dear Michael, Yes, each thread in my system has its own IndexWriter. But all of them are synchronized by a unique lock. So I think the exception should not occur, right? If the threads share a single IndexWriter, what about the performance? I don't need to synchronize by myself if so, right? I ap

RE: Exceptions When Indexing with Multi-threading

2009-10-29 Thread Michael Garski
Does each thread have its own IndexWriter? This could cause the issue you describe. IndexWriter is thread-safe so that multiple threads can use the same instance, however you will see a performance degradation compared to only having one thread modify the index. We've done quite a bit of testing

RE: Exceptions When Indexing with Multi-threading

2009-10-29 Thread Digy
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,