"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#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...