Github user hirthwork commented on the pull request:
https://github.com/apache/httpcore/pull/7#issuecomment-62699517
Yes, this is a part of performance improvement, but I don't believe you
want to have these
[crutches](https://gist.github.com/hirthwork/f0f1a6693690774c1cb0) in master.
The idea is to move channel.close() to separate thread. Channel can be also
closed by selector, so before closing channel is being registered in fake
selector, so main IOReactor thread won't be blocked.
Using volatiles for lastRead/Write/AccessTime is the generic improvement
which will improve performance of current implementation.
Using atomic for status doesn't look like a fair tradeoff. You will improve
performance of .close() function a bit, but other functions will be forced to
call status.get() inside the lock, so overall performance could degrade.
close() is called once per session lifetime while event mask operations can be
called several times (hundreds of times for proxies like NHttpReverseProxy from
examples).
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]