Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 870491193F for ; Mon, 21 Jul 2014 17:14:40 +0000 (UTC) Received: (qmail 87702 invoked by uid 500); 21 Jul 2014 17:14:39 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 87639 invoked by uid 500); 21 Jul 2014 17:14:39 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 87625 invoked by uid 99); 21 Jul 2014 17:14:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 17:14:39 +0000 Date: Mon, 21 Jul 2014 17:14:39 +0000 (UTC) From: "Gregory Chanan (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (SOLR-6252) Simplify UnInvertedField#getUnInvertedField synchronization module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-6252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068795#comment-14068795 ] Gregory Chanan edited comment on SOLR-6252 at 7/21/14 5:13 PM: --------------------------------------------------------------- Also, the synchronized lock is held when checking the placeholder, when it really only needs to be held for the get/put. (it's subtle to get that correct though, because the non-placeholder needs to be notified correctly, so probably not worth doing. was (Author: gchanan): Also, the synchronized lock is held when checking the placeholder, when it really only needs to be held for the get/put. > Simplify UnInvertedField#getUnInvertedField synchronization module > ------------------------------------------------------------------ > > Key: SOLR-6252 > URL: https://issues.apache.org/jira/browse/SOLR-6252 > Project: Solr > Issue Type: Improvement > Components: search > Affects Versions: 5.0 > Reporter: Vamsee Yarlagadda > Assignee: Mark Miller > Priority: Minor > Attachments: SOLR-6252.patch, SOLR-6252v2.patch > > > Looks like UnInvertedField#getUnInvertedField has implemented a bit additional synchronization module rather than what is required, and thereby increasing the complexity. > https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/request/UnInvertedField.java#L667 > As pointed out in the above link, as the synchronization is performed on the cache variable(which itself will protect the threads from obtaining access to the cache), we can safely remove all the placeholder flags. As long as cache.get() is in synchronized block, we can simply populate the cache with new entries and other threads will be able to see the changes. > This change has been introduced in https://issues.apache.org/jira/browse/SOLR-2548 (Multithreaded faceting) -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org