[jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool

2017-06-20 Thread Oleg Kalnichevski (JIRA)

[ 
https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16055348#comment-16055348
 ] 

Oleg Kalnichevski commented on HTTPCORE-469:


[~MattNelson] Please note HTTPCORE-390 is very unlikely to get ported to 4.x. 
If you want to see a better lock strategy implemented in the 4.x release series 
someone will need to come forward and do the necessary work.

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
>Assignee: Oleg Kalnichevski
>Priority: Minor
>  Labels: stuck, volunteers-wanted
> Fix For: Future
>
>
> 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.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool

2017-06-19 Thread Matt Nelson (JIRA)

[ 
https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16054222#comment-16054222
 ] 

Matt Nelson commented on HTTPCORE-469:
--

I'm ok with waiting for the lockless connection pool. I have not noticed any 
performance issues with the current implementation for my use cases, but 
thought I'd put out the recommendation for the lock refactoring.

> 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
>Assignee: Oleg Kalnichevski
>Priority: Minor
>  Labels: stuck, volunteers-wanted
> Fix For: Future
>
>
> 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.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool

2017-06-19 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16054184#comment-16054184
 ] 

Gary Gregory commented on HTTPCORE-469:
---

I agree. If someone wants to step in and do the works, great, otherwise let's 
leave it. It seems tricky to get this kind of code right and trickier to prove 
you've done it right with unit tests.

> 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
>Assignee: Oleg Kalnichevski
>Priority: Minor
>  Labels: stuck, volunteers-wanted
> Fix For: Future
>
>
> 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.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-469) Use ReentrantReadWriteLock in AbstractConnPool

2017-05-19 Thread Oleg Kalnichevski (JIRA)

[ 
https://issues.apache.org/jira/browse/HTTPCORE-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org