[
https://issues.apache.org/jira/browse/ARTEMIS-2095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628448#comment-16628448
]
ASF GitHub Bot commented on ARTEMIS-2095:
-----------------------------------------
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/2328
@michaelandrepearce I have done some experiments on it and I have noticed
that the issue is the contention of the `state` field on `StampedLock` with the
rest of the surrounding fields on the heap. Just using a `AtomicLongArray` of
32 elements (256 bytes) and using the 16th element to hold the state is enough
to avoid any weird contention issues with multi-sockets setup.
The effects of such change is so evident that just using a single-socket
CPU would already benefit by this change.
The point is that it is an extreme way to improve perf on this and I don't
know if we've such high contention of TypedProperties to justify it...
> TypedProperties thread safety
> -----------------------------
>
> Key: ARTEMIS-2095
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2095
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Michael Andre Pearce
> Assignee: Michael Andre Pearce
> Priority: Major
>
> Whilst TypedProperties is meant to have a single thread acting on it (and
> this is the most typical interaction), there are occurrences where, it can be
> acted on by other threads, when this occurs some concurrent modification
> errors can occur.
> As such TypedProperties must be thread safe, but concurrency tuning should
> factor in to be most performant for single thread.
>
> e.g.
> 2018-09-24 15:01:27,751 WARN
> [org.apache.activemq.artemis.core.message.impl.CoreMessage] Error creating
> String for message: : java.util.ConcurrentModificationException at
> java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) [rt.jar:1.8.0_102]
> at java.util.HashMap$EntryIterator.next(HashMap.java:1471) [rt.jar:1.8.0_102]
> at java.util.HashMap$EntryIterator.next(HashMap.java:1469) [rt.jar:1.8.0_102]
> at
> org.apache.activemq.artemis.utils.collections.TypedProperties.toString(TypedProperties.java:464)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)