[
https://issues.apache.org/jira/browse/ARTEMIS-1356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16136745#comment-16136745
]
ASF GitHub Bot commented on ARTEMIS-1356:
-----------------------------------------
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1477
@clebertsuconic
Here:
https://github.com/apache/activemq-artemis/blob/e81c8c26d02f156e75fe03cb8cc8ad92e4bca30e/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java#L231
On each first ThreadLocal::get call from a different thread, the
ThreadLocal allocates and cache (locally to the thread) a new AtomicBoolean.
In addition, the AtomicBoolean::get and AtomicBoolean::set operations can
be avoided to "mark" the handler thread...
> Avoid allocations and atomic operations to recognize handler's thread
> ---------------------------------------------------------------------
>
> Key: ARTEMIS-1356
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1356
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
>
> The current way to recognize the handler's thread is using heavyweight
> operations (allocations + atomic set/get) that limit some compiler
> optimizations on the (core) packet handling path.
> The same logic can be achieved using only a ThreadLocal map and a cached
> marker instance.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)