class A implements Callable{
List result // want to share this List amongst thread and their function call
public Search call() {
List<Job> Jobs = api. Jobs(a,b,c); // Multiple threads
}
}
class API{
public void jobs(a,b,c){
// want to access the A.Result and populate the result
}
}
How can i share an array List amogst all threds, I dont want to use the Static ,
as it will keep accumilating the result every time it runs ,
Is Thread Local is a good choice over here ?
Trying to avoid an extra object and its respective getters / setters ?
What ever you have right now is thread shared list. All threads operating on this object
(assuming only one instance of this object exists) share same list unless you synchronize.