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 4F5E2200C79 for ; Fri, 19 May 2017 09:52:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4DCC9160BD1; Fri, 19 May 2017 07:52:09 +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 940E2160BBE for ; Fri, 19 May 2017 09:52:08 +0200 (CEST) Received: (qmail 93573 invoked by uid 500); 19 May 2017 07:52:07 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 93562 invoked by uid 99); 19 May 2017 07:52:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2017 07:52:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 55725C05B0 for ; Fri, 19 May 2017 07:52:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id f_BI_Hca5c4o for ; Fri, 19 May 2017 07:52:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 551D25FC64 for ; Fri, 19 May 2017 07:52:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BBE87E05BF for ; Fri, 19 May 2017 07:52:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0CD2721B56 for ; Fri, 19 May 2017 07:52:04 +0000 (UTC) Date: Fri, 19 May 2017 07:52:04 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 19 May 2017 07:52:09 -0000 [ https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017030#comment-16017030 ] Oleg Kalnichevski commented on HTTPCORE-469: -------------------------------------------- Hi Matt At some point of time I would like to try building a lock-less pool implementation (see HTTPCORE-390). We cannot use {{StampedLock}} for now. This might change later in the 5.0 release cycle though. If you could raise a PR at Github with changes switching to {{ReentrantReadWriteLock}} I'll happily merge them. I imagine it should just be a matter of changing {{ReentrantLock}} with {{ReentrantReadWriteLock}} but maybe there is more to it. Oleg > Use ReentrantReadWriteLock in AbstractConnPool > ---------------------------------------------- > > Key: HTTPCORE-469 > URL: https://issues.apache.org/jira/browse/HTTPCORE-469 > Project: HttpComponents HttpCore > Issue Type: Improvement > Components: HttpCore > Reporter: Matt Nelson > Priority: Minor > > AbstractConnPool is currently using a {{ReentrantLock}} which has to lock for read and write operations. Switching to {{ReentrantReadWriteLock}}[1] and read locks for the stats/getters methods would reduce the possibility for instrumentation[1] to cause contention. Another option would be {{StampedLock}}[3] if the compile target is 1.8. > [1] https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html > [2] https://github.com/dropwizard/metrics/blob/v3.2.2/metrics-httpclient/src/main/java/com/codahale/metrics/httpclient/InstrumentedHttpClientConnectionManager.java#L63-L95 > [3] https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org