Synchronization of new data with previous data I am working with synchronization for the first time. I wrote some code that I have to implement in my current work. I wanted to know if I am doing it right or am I making a mistake. 

Whenever a new list of data is downloaded, NewDataArrived() is called. This method then calls the ListData() that returns the list of previously saved data. There is another class running in parallel that uses the ListData(). What I want to do is whenever the List is being updated, the Thread class should just wait until the list is updated.

public class ListData() {

/*
*
*




*/
public List &lt; name_holder &gt; getList() {
    synchronized(LOCK_LIST) {
        if (newDataArrived)
            LOCK_LIST.notifyAll();

        return full_list;
    }
}


void NewDataArrived() {

    newDataArrived = true;
    parallelDownload p = new parallelDownload();
    p.start();
    getList().addAll(my_list);
    newDataArrived = false;


}

class parallelDownload extends Thread {
    private Object o = new Object();

    @Override
    public void run() {
        synchronized(o) {
            for (name_holder n: getList()) {
                while (newDataArrived) {
                    try {
                        o.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}
}
Coding Conventions

First of all: You should follow common naming conventions for Java.  It makes it harder to read your code if you don't -- or to put it differently: It is easier to help if the code does follow common conventions.  Maybe have a look at Google's Java Style or at least:


write methods in lowerCamelCase style and
classes in UpperCamelCase style.


Furthermore it would be good to provide a compilable minimal example. 

Threadsafe List

From what I understood you want to have a list which is capable of being accessed and modified from multiple threads.  If so, you may have a look at this stackoverflow discussion.  

Java Concurrency

Some general things: 


You don't need to instantiate an object for your synchronized blocks.  If you do not specify an object, the current object is used.  That should be sufficient for your use cases.
Don't start a thread directly.  Rather use an ExecutorService instead.
Don't subclass Thread, but rather use a Runnable (also see here).
Very good book on the whole topic: Java Concurrency in Practice.