Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1DC0D200BE7 for ; Tue, 20 Dec 2016 19:40:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1C5FF160B33; Tue, 20 Dec 2016 18:40:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91237160B12 for ; Tue, 20 Dec 2016 19:40:04 +0100 (CET) Received: (qmail 77316 invoked by uid 500); 20 Dec 2016 18:39:58 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 77235 invoked by uid 99); 20 Dec 2016 18:39:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2016 18:39:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 78DE72C2A66 for ; Tue, 20 Dec 2016 18:39:58 +0000 (UTC) Date: Tue, 20 Dec 2016 18:39:58 +0000 (UTC) From: "Ben Manes (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JCS-119) replace synchronized blocks by java locks or concurrenhashmap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 20 Dec 2016 18:40:05 -0000 [ https://issues.apache.org/jira/browse/JCS-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15764911#comment-15764911 ] Ben Manes commented on JCS-119: ------------------------------- Perfect. You might want to drop the embedded copy of ConcurrentHashMapV8. That backport has higher performance, but utilizes Unsafe. Now that JDK8 is released, those who want the extra performance would most likely upgrade JVMs. > replace synchronized blocks by java locks or concurrenhashmap > ------------------------------------------------------------- > > Key: JCS-119 > URL: https://issues.apache.org/jira/browse/JCS-119 > Project: Commons JCS > Issue Type: Improvement > Reporter: Romain Manni-Bucau > Assignee: Thomas Vandahl > Fix For: jcs-2.1 > > > A cache is typically used in a concurrent environment. Since Java 6 using a ReentrantLock is faster than synchronized so can be interesting to replace synchronized blocks by a lock. > Places i'm thinking about: > * CompositeCache > * AbstractDoubleLinkedListMemoryCache > * LHMLRUMemoryCache > * DoubleLinkedList > * LRUMap > * SingleLinkedList > * SortedPreferentialArray > Some places where replacing a HashMap by a ConcurrentHashMap can allow to get rid of synchronized without needing a lock: > * CacheEventQueue > * AbstractDiskCache > * CacheWatchRepairable > There are other places but this is the main I saw. -- This message was sent by Atlassian JIRA (v6.3.4#6332)