[jboss-dev-forums] [Design of JBossCache] - Re: markNodeCurrentlyInUse() - race condition

manik.surtani@jboss.com do-not-reply at jboss.com
Thu Jan 18 09:33:57 EST 2007


I agree that it is ugly and placing a marker directly on the node makes more sense.

I also agree that using the event queue for this kind of data is pretty hacky, but let's revisit the purpose of this method (and Brian will probably have stuff to add here)

markNodeCurrentlyInUse() does (should) not prevent node removal by calling one of the remove methods.  All it should do is prevent the node from being evicted.  And if this is the case, then a marked in the event queue should be sufficient since the event processor thread would find the in-use marker before any eviction markers.

I guess where this can be a problem is if a node is marked for eviction first, and then is marked as in-use, and then the event processor thread starts.  

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

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



More information about the jboss-dev-forums mailing list