From lucene-net-dev-return-1967-apmail-incubator-lucene-net-dev-archive=incubator.apache.org@incubator.apache.org Mon Apr 20 08:14:17 2009 Return-Path: Delivered-To: apmail-incubator-lucene-net-dev-archive@minotaur.apache.org Received: (qmail 36330 invoked from network); 20 Apr 2009 08:14:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Apr 2009 08:14:17 -0000 Received: (qmail 94467 invoked by uid 500); 20 Apr 2009 08:14:16 -0000 Delivered-To: apmail-incubator-lucene-net-dev-archive@incubator.apache.org Received: (qmail 94388 invoked by uid 500); 20 Apr 2009 08:14:16 -0000 Mailing-List: contact lucene-net-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@incubator.apache.org Delivered-To: mailing list lucene-net-dev@incubator.apache.org Received: (qmail 94378 invoked by uid 99); 20 Apr 2009 08:14:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Apr 2009 08:14:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Apr 2009 08:14:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7CD0A234C004 for ; Mon, 20 Apr 2009 01:13:47 -0700 (PDT) Message-ID: <726501055.1240215227498.JavaMail.jira@brutus> Date: Mon, 20 Apr 2009 01:13:47 -0700 (PDT) From: "Digy (JIRA)" To: lucene-net-dev@incubator.apache.org Subject: [jira] Commented: (LUCENENET-181) Port of ThreadLocal is wrong? In-Reply-To: <98966893.1240167587455.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENENET-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700691#action_12700691 ] Digy commented on LUCENENET-181: -------------------------------- As far as I can understand you; you are saying that "ThreadLocal" is used as a syncronization primitive between threads. If true, then Lucene.Net works as expected. What makes me confused is the definition of "ThreadLocal": *This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread* DIGY > Port of ThreadLocal is wrong? > ----------------------------- > > Key: LUCENENET-181 > URL: https://issues.apache.org/jira/browse/LUCENENET-181 > Project: Lucene.Net > Issue Type: Improvement > Reporter: Digy > Priority: Minor > Attachments: TestCase.cs > > > AFAIK, "ThreadLocal" in Java is there to hold objects which are intented to be used thread-wide. So, its port-equivalent "LocalDataStoreSlot" should contain objects related with the executing thread. But, since they are not declared as "static" in Analyzer.cs, FieldsReader.cs, SegmentReader.cs and TermInfosReader.cs, they are created with every class contruction, changing the behaviour of "ThreadLocal" and possibly resulting in performance degradation. > I will attach a test case for this issue. > If I am wrong, then there is no problem. But If I am right we are in trouble; Since adding "static" to variables declared as LocalDataStoreSlot results in failing of almost all test cases. > DIGY -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.