[jboss-dev-forums] [JBoss ESB Development] - Re: Performance Improvement Proposal: Cache result of HttpSe
Kevin.Conner@jboss.com
do-not-reply at jboss.com
Tue Dec 8 04:57:46 EST 2009
"dward" wrote : That's good to know Bill, thanks. The difference with what I'm doing is that it's not a member variable (the map) that is being set lazily, but a populated entry in the map, so we just have to be careful against ConcurrentModificationExceptions.
That is certainly one issue but nothing to do with the memory model.
"dward" wrote : Kev, if you're okay with me not using ConcurrentHashMap (and instead using synchronized as I elaborated on above), let me know. Either way, I'll wait for your word before I commit to the performance workspace and 4.7 CP branch. Thanks.
Your code above is not thread safe, please do not commit that. Double checking is not where it is falls down, rather it is the updates to the structure of the map that would not be propagated correctly in certain memory models.
The only reason Bill's example works is because of the volatile keyword, as that now has the same semantics as synchronized, wrt memory.
Kev
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269520#4269520
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269520
More information about the jboss-dev-forums
mailing list