lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eyal post (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-181) Port of ThreadLocal is wrong?
Date Sun, 19 Apr 2009 19:27:47 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700603#action_12700603
] 

eyal post commented on LUCENENET-181:
-------------------------------------

Reading the documentation on LocalDataStoreSlot  vs ThreadLocal they seem to have the same
semantics and I think the usage in Lucense is correct. Since the Java version doesn't declare
the variable as static it will have a different value per instance\per thread and this is
exactly how the .net version behaves.


> 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.


Mime
View raw message