Hello,

I was browsing the CAS source code and I think there could be a little
enhancement in the DefaultServicesManagerImpl class.

This class allows to reload the list of registered services by using the
serviceRegistryDao. In the load method, we build a new ConcurrentHashMap
and assign it to the field "services".

I think this field has to be declared as volatile because other threads
could see either an outdated value for the reference or worst no change at
all (see the Brian Goetz article, listing 4.
http://www.ibm.com/developerworks/library/j-jtp06197/).

I'm aware that nobody has never detected this possible bug and it is
probably because the threads don't stay very long in the
DefaultServicesManagerImpl; the old field reference does not stay in the
 processors caches and is refreshed during the next access.

Do you share my analysis? Could we fix this class?

Thank you,

Michaël

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

Reply via email to