hmmm agree with you that the clear() can cause problems in a normal operation. but why do you think a global lock will not help? if we use a share/exclusive global lock, in which the clear acquires it exclusively, then we make sure that we have no operation interacting with the cache and it is safe to clear