[ 
https://issues.apache.org/jira/browse/LUCENE-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir updated LUCENE-2943:
--------------------------------

    Attachment: LUCENE-2943.patch

Updated patch: I clone the JDK ones too.

Its not really the case that these are "thread-safe", instead really what 
happens is their methods are synced (if they are correct). So its good to clone 
to reduce contention.

Also i took a look at harmony, which simply wraps the ICU impl and doesn't 
sync, which means its not thread safe (but should be).

For these reasons I think we should just clone the JDK one for safety too.


> ICU collator thread-safety issues
> ---------------------------------
>
>                 Key: LUCENE-2943
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2943
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2943.patch, LUCENE-2943.patch
>
>
> The ICU Collators (unlike the JDK ones) aren't thread safe: 
> http://userguide.icu-project.org/collation/architecture , a little 
> non-obvious since its not mentioned
> in the javadocs, and its not clear if the docs apply to only the C code, but 
> i looked
> at the source and there is all kinds of internal state.
> So in my opinion, we should clone the icu collators (which are passed in from 
> the outside) 
> when creating a new TokenStream/AttributeImpl to prevent problems. This 
> shouldn't be a big
> deal since everything uses reusableTokenStream anyway.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to