[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    [jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool
From:       "Oleg Kalnichevski (JIRA)" <jira () apache ! org>
Date:       2017-05-19 7:52:04
Message-ID: JIRA.13073190.1495124941000.248189.1495180324050 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugi \
n.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/j \
> ava/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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic