lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3656) IndexReader's add/removeCloseListener should not use ConcurrentHashMap, just a synchronized set
Date Mon, 19 Dec 2011 20:31:32 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-3656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172588#comment-13172588
] 

Yonik Seeley commented on LUCENE-3656:
--------------------------------------

bq. this seems a pretty good usecase for CopyOnWriteArraySet.

+1, good call.
                
> IndexReader's add/removeCloseListener should not use ConcurrentHashMap, just a synchronized
set
> -----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3656
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3656
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 3.5, 4.0
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>            Priority: Minor
>              Labels: curiosity
>         Attachments: LUCENE-3656.patch
>
>
> The use-case for ConcurrentHashMap is when many threads are reading and less writing
to the structure. Here this is just funny: The only reader is close(). Here you can just use
a synchronized HashSet. The complexity of CHM is making this just a joke :-)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message