[jbosstools-issues] [JBoss JIRA] (JBIDE-23466) Refactor ConnectionWrapper class for better support of mulithreading

Rob Stryker (JIRA) issues at jboss.org
Fri Nov 4 19:03:00 EDT 2016


    [ https://issues.jboss.org/browse/JBIDE-23466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13317782#comment-13317782 ] 

Rob Stryker commented on JBIDE-23466:
-------------------------------------

I looked at the code here and everything seems fine except the fireChanged. There are other small improvements you can make to make it more efficient and block for a shorter time, but there's really no problem with using synchronized because sometimes you really do need to make sure the entire method completes as a block, not just the addition or removal of one k/v pair. 

My point is, switching to concurrent might actually introduce more bugs. You will probably move to concurrent and remove all teh synchronized blocks, and end up with one variable modified and the other not yet modified, ie a model in inconsistant state. 

> Refactor ConnectionWrapper class for better support of mulithreading
> --------------------------------------------------------------------
>
>                 Key: JBIDE-23466
>                 URL: https://issues.jboss.org/browse/JBIDE-23466
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: openshift
>    Affects Versions: 4.4.1.AM3
>            Reporter: Dmitrii Bocharov
>              Labels: openshift_v3, watcher
>             Fix For: 4.4.x
>
>
> The initial discussion started here: https://github.com/jbosstools/jbosstools-openshift/pull/1359#discussion_r86245175
> The problem is that ConnectionWrapper contains a lot of synchronized blocks, that can be bottlenecks. We need to think about using ConcurentHashMap for projects Map or refactor the whole logic of using global variables: projects and resourceCache to make them work synchronously.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jbosstools-issues mailing list