You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/02/11 23:32:11 UTC
[jira] [Commented] (QPID-6387) ChannelToSessionMap/IdToConsumerMap
array optimisation publishes in thread unsafe manner
[ https://issues.apache.org/jira/browse/QPID-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14317112#comment-14317112 ]
ASF subversion and git services commented on QPID-6387:
-------------------------------------------------------
Commit 1659103 from [~k-wall] in branch 'qpid/trunk'
[ https://svn.apache.org/r1659103 ]
QPID-6387: [Java Client] Remove array optimisation from session/consumer maps
> ChannelToSessionMap/IdToConsumerMap array optimisation publishes in thread unsafe manner
> ----------------------------------------------------------------------------------------
>
> Key: QPID-6387
> URL: https://issues.apache.org/jira/browse/QPID-6387
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Keith Wall
> Assignee: Keith Wall
> Fix For: 0.31
>
>
> Two internal classes within the Java Client (ChannelToSessionMap / IdToConsumerMap) use an optimisation which hopes to permit 'fast access' first sixteen sessions (or consumers) by making use on an array. The array is written by one thread and then read by others. Unfortunately, the read/writes are not protected using a memory barrier so it is possible a thread may see a stale value, and this could lead to incorrect program behaviour.
> It is safer (and simpler) to replace the data structure with one backed by a ConcurrentHashMap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org