[jboss-user] [JBoss Cache: Core Edition] - Traversing and filtering of Tree Structured objects and thre

chetanparekh do-not-reply at jboss.com
Thu Nov 6 05:16:57 EST 2008


We are catching objects of tree structured class in cache. Following is the signature of class

Class :  MyClass
An object of MyClass can have any number of children of the same type and children can have any number of their children as well. This can continue upto N level.

Methods
public MyClass addChild (MyClass child) 
public Collection getChildren (ArralyList filter)
This method take ArrayList as an input and return ArrayList of children - baring those which exist in ArrayList filter. Method uses Iterator to traverse through ArrayList during filtration. 

We fetch these objects from cache, traverse through them and read all node values. We are accessing these objects in read-only mode; there will not be any write operation on these objects.

Problem:
Total concurrent users of the application are around 20K and multiple thread are going to call getChildren(ArralyList filter). Parameter value for filter will very from user to user. Now suppose first thread calls getChildren (ArrayList filter) method and it reaches half the way. First thread loose the control and second thread get the control and calls getChildren (ArrayList filter) by passing different value for parameter filter.

Will this operation thread safe?

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

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



More information about the jboss-user mailing list