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

Earwin Burrfoot commented on LUCENE-2171:
-----------------------------------------

(without looking deep) I have a feeling that for RW Reader _synchronized_ is 
also unnecessary - _volatile_ will suffice.

> Over synchronization for read-only index readers in SegmentTermDocs
> -------------------------------------------------------------------
>
>                 Key: LUCENE-2171
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2171
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 2.9.1, 3.0
>            Reporter: Jayson Minard
>            Priority: Minor
>             Fix For: 3.1
>
>
> In SegmentTermDocs constructor (from 2.9.1)
> {code}
> 46      protected SegmentTermDocs(SegmentReader parent) {
> 47        this.parent = parent;
> 48        this.freqStream = (IndexInput) parent.core.freqStream.clone();
> 49        synchronized (parent) {
> 50          this.deletedDocs = parent.deletedDocs;
> 51        }
> 52        this.skipInterval = parent.core.getTermsReader().getSkipInterval();
> 53        this.maxSkipLevels = 
> parent.core.getTermsReader().getMaxSkipLevels();
> 54      }
> {code}
> The synchronization on "parent" for accessing deletedDocs is unnecessary on 
> readonly indexes.  If that access was moved into the SegmentReader then it 
> could be protected there by default and overridden in ReadonlySegmentReader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to