Q:

Java: how to compare object in different threads

I have a server listening data from clients.  Once a client sends data, it will go into a thread.  Thus, each thread has a data.  revFeaturePoints is the data which the server receives from clients. 
Each revFeaturePoints has a float array, I want to compute the Euclidean distance between different revFeaturePoints in different thread? 
I do not know how can let one thread to access another revFeaturePoints in other threads? 
Here is the code:
public class MyServer {

public static void main(String[] args) throws IOException{
    ServerSocket serverSocket = null;

    //bind a serverSocket to the port and listen
    try{
        serverSocket = new ServerSocket(8888);
        System.out.println("Listening: 8888");
    }catch(IOException e){
        e.printStackTrace();
    }

    while(true)
        new MyServerThread(serverSocket.accept()).start();
}   
}

public class MyServerThread  extends Thread{
//Create a socket for each client
private Socket socket = null;
private ObjectInputStream dataInputStream = null;
private ObjectOutputStream dataOutputStream = null;
private ArrayList<FeaturePointList> revFeaturePoints = null;

//constructor
public MyServerThread(Socket socket){
    super("MyServerThread");
    this.socket = socket;
}

@SuppressWarnings("unchecked")
public void run(){
    try{            
        dataOutputStream = new ObjectOutputStream(socket.getOutputStream());
        dataInputStream = new ObjectInputStream(socket.getInputStream());
        System.out.println("ip: "+ socket.getInetAddress());
        revFeaturePoints = (ArrayList<FeaturePointList>) dataInputStream.readObject();          

    }catch(IOException e){
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } 
    finally{
        if(socket!=null){
            try{
                socket.close();
            }catch(IOException e){
                e.printStackTrace();
            }
        }
        if(dataInputStream!=null){
            try{
                dataInputStream.close();
            }catch(IOException e){
                e.printStackTrace();
            }               
        }
        if(dataOutputStream!=null){
            try{
                dataOutputStream.close();
            }catch(IOException e){
                e.printStackTrace();
            }               
        }

    }
}

}

A:

A simple way would be putting a synchronized method in MyServerThread that returns the data. 
Another way of doing it would be to use a BlockingQueue and place the data result in a queue and taking the results from this as a producer-consumer pattern.  See here for a way of doing this.