hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hirthwork <...@git.apache.org>
Subject [GitHub] httpcore pull request: Reduce synchronized scopes in IOSessionImpl
Date Tue, 11 Nov 2014 13:24:49 GMT
GitHub user hirthwork opened a pull request:

    https://github.com/apache/httpcore/pull/7

    Reduce synchronized scopes in IOSessionImpl

    Currently IOSessionImpl has too many synchronized methods which results in poor performance
on high load.
    Changes consist of two commits:
    First one removes synchronization from lastRead/Write/AccessTime variables access and
makes this variables volatile.
    Second one introduces double checks for status member-field which is already volatile.
At the same time, synchronized (this) scope in IOSessionImpl.close() reduced to have double
checks faster.
    In order to avoid CancelledKeyException in .toString() member-function key cancellation
is made in scope synchronized on this key.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/hirthwork/httpcore 4.4.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/httpcore/pull/7.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #7
    
----
commit e81a8a4745e6c56797099210f2426f618bd00ca8
Author: Dmitry Potapov <dpotapov@yandex-team.ru>
Date:   2014-11-11T13:06:18Z

    IOSessionImpl: use volatiles for time access functions instead of synchronized access

commit 8d8a8aa57470a9e32de9a9857216eb666c1cb005
Author: Dmitry Potapov <dpotapov@yandex-team.ru>
Date:   2014-11-11T13:16:48Z

    IOSessionImpl: use double checks whenever it is possible to reduce synchronized scope

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message