Return-Path: Delivered-To: apmail-incubator-lucene-net-user-archive@minotaur.apache.org Received: (qmail 30686 invoked from network); 29 Oct 2009 16:34:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Oct 2009 16:34:13 -0000 Received: (qmail 74269 invoked by uid 500); 29 Oct 2009 16:34:13 -0000 Delivered-To: apmail-incubator-lucene-net-user-archive@incubator.apache.org Received: (qmail 74212 invoked by uid 500); 29 Oct 2009 16:34:12 -0000 Mailing-List: contact lucene-net-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-user@incubator.apache.org Delivered-To: mailing list lucene-net-user@incubator.apache.org Received: (qmail 74202 invoked by uid 99); 29 Oct 2009 16:34:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 16:34:12 +0000 X-ASF-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mgarski@myspace-inc.com designates 216.32.180.15 as permitted sender) Received: from [216.32.180.15] (HELO VA3EHSOBE006.bigfish.com) (216.32.180.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 16:34:09 +0000 Received: from mail6-va3-R.bigfish.com (10.7.14.249) by VA3EHSOBE006.bigfish.com (10.7.40.26) with Microsoft SMTP Server id 8.1.340.0; Thu, 29 Oct 2009 16:33:45 +0000 Received: from mail6-va3 (localhost.localdomain [127.0.0.1]) by mail6-va3-R.bigfish.com (Postfix) with ESMTP id AC6701F01A3; Thu, 29 Oct 2009 16:33:45 +0000 (UTC) X-SpamScore: -7 X-BigFish: VPS-7(zz542N9371Pzz1202hzz5a6ciz31n6bh61h) X-Spam-TCS-SCL: 0:0 Received: by mail6-va3 (MessageSwitch) id 12568340256352_22581; Thu, 29 Oct 2009 16:33:45 +0000 (UCT) Received: from VA3EHSMHS014.bigfish.com (unknown [10.7.14.253]) by mail6-va3.bigfish.com (Postfix) with ESMTP id EB5DB210051; Thu, 29 Oct 2009 16:33:44 +0000 (UTC) Received: from fegplmsmmdz04.foxinc.com (216.205.229.107) by VA3EHSMHS014.bigfish.com (10.7.99.24) with Microsoft SMTP Server (TLS) id 14.0.482.32; Thu, 29 Oct 2009 16:33:39 +0000 Received: from ffeplmsexbh03.ffe.foxeg.com (Not Verified[10.136.102.125]) by FOX.COM (post.office MTA v5.0 0924 ) with ESMTP id ; Thu, 29 Oct 2009 09:33:36 -0700 Received: from fegplmsexmb14.ffe.foxeg.com ([10.136.102.19]) by ffeplmsexbh03.ffe.foxeg.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 29 Oct 2009 09:33:38 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Exceptions When Indexing with Multi-threading Date: Thu, 29 Oct 2009 09:33:36 -0700 Message-ID: <7112862FD2F84D49927A5A5E0758451E01D932E9@fegplmsexmb14.ffe.foxeg.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Exceptions When Indexing with Multi-threading Thread-Index: AcpYXKxZoP6ea0FxRS2TncmxXuAYhwAWIT6w References: From: Michael Garski To: , X-OriginalArrivalTime: 29 Oct 2009 16:33:38.0200 (UTC) FILETIME=[91356180:01CA58B5] X-Reverse-DNS: fegplmsmmdz04.foxinc.com 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 for that case a while back and only have one thread modifying an index at a time. Michael -----Original Message----- From: Li Bing [mailto:lblabs@gmail.com]=20 Sent: Wednesday, October 28, 2009 10:57 PM 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