Maarten Bosteels <[EMAIL PROTECTED]> writes:

> I think there is theoretically still a chance that two threads
> synchronize on different lock object for the same session:

This is a classic "check-then-act" problem. If we don't control the
underlying map used by IoSession.(get|set)Attribute(), preventing
approaches like the looping ConcurrentHashMap example in "Java
Concurrency in Practice"¹, we must lock at a higher level.


Footnotes: 
¹ http://www.javaconcurrencyinpractice.com/listings/Memoizer.java

-- 
Steven E. Harris

Reply via email to