[jboss-dev-forums] [Design of JBossCache] - Re: Eviction thread behaviour

bstansberry@jboss.com do-not-reply at jboss.com
Wed Oct 25 11:08:32 EDT 2006


"ben.wang at jboss.com" wrote : 
  | I don't think it is necessarily true that if a node has a read/write lock, it should not be evicted. Take for example the eivction policy of FIFO or policy with a node max age. Both will evict the corresponding node even when it just has been accessed.
  | 

I understand what you mean about FIFO or max age, but if eviction doesn't respect locks that can lead to serious problems; i.e. user thread doing a get acquires a lock in PessimisticLockInterceptor, then eviction thread evicts node, then user thread reaches TreeCache._get, which does a findNode, gets nothing and returns null.  No chance to reload from the cache loader as the user thread is already past the interceptor.

Writing the above sparked a tangential thought; may be terrible, haven't thought about implications, etc.  When an interceptor finds a node, why not throw it in the InvocationContext or something similar and pass it through the stack that way?  Subsequently calls to find the node can check the context first before walking the cache tree.  Saves redundant walking of the tree.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980728#3980728

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980728



More information about the jboss-dev-forums mailing list