anonymous wrote :
| The concern I have re: thread safety is if a collection backed by the internal data
structure of a node is exposed, you can get a ConcurrentModificationException just
iterating over it. Not sure if that really happens. I saw NodeImpl.getDataKeys() exposes a
collection backed by the data map. Haven't followed the code to see what happens to
it. But, if that gets passed to a caller, any lock on the node could easily be released
before the collection is even received by the caller (assume no tx). Thus easy to have
another thread modify the data map via a put/remove while the first thread is iterating.
Actually, as I write this, if what I'm describing is there, it's not a javadoc
issue, it's something that needs to be changed.
|
getKeys() and getData() currently return unmodifiable maps based on the internal data
structures in a node. I see your point about CMEs. This would have to be a simple copy I
suppose, but I'm not too keen on the performance overhead of this copy. It seems to
be the most 'correct' thing to do though.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979046#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...