From dev-return-68526-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Mon Dec 24 12:50:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 40B5B180660 for ; Mon, 24 Dec 2018 12:50:24 +0100 (CET) Received: (qmail 43499 invoked by uid 500); 24 Dec 2018 11:50:23 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 43487 invoked by uid 99); 24 Dec 2018 11:50:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Dec 2018 11:50:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 52CE9E119B; Mon, 24 Dec 2018 11:50:22 +0000 (UTC) From: franz1981 To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis issue #2478: ARTEMIS-2210 PagingStore creation is not prope... Content-Type: text/plain Message-Id: <20181224115022.52CE9E119B@git1-us-west.apache.org> Date: Mon, 24 Dec 2018 11:50:22 +0000 (UTC) Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/2478 @gaohoward The synchronized block will block any threads attempting to both getting and creating a paging store, while a chm::get is lock-free ie won't block any threads and chm::computeIfAbsent is locked on per-segment basis (that means that depends on the number of segments and how the hashing of the keys will distribute the entries into the segment. Putting a synchronized like this will prevent any threads to do anything on an hot-path, blocking each others: my advice is to keep chm::get lock-free (as it is now) and into `newStore(storeName)` use chm::computeIfAbsent to avoid duplicates creatings of `PagingStore` instances. This should keep the scalability as it is now without allocating unnecessary instances. wdyt? ---