title: java - general synchronizedList question
body: <p>I have a general question regarding synchronized List.<br>
  Lets say that in the constructor I am createing a list  </p>
  
  <pre><code>List synchronizedList = Collections.synchronizedList(list);
  </code></pre>
  
  <p>and I have one method adds an object to the list.   </p>
  
  <pre><code>public void add(String s){ 
      synchronizedList.add(s)
  }
  </code></pre>
  
  <p>There is another thread that checks every few seconds if there are a few rows , dump it to a file and deletes them all.   </p>
  
  <p>Now lets say I iterate each row and save it to the db. 
  after all iteration I clear the list. </p>
  
  <p>How does the multithread support help me?<br>
  I could add an element to the list just before the clear() in the other thread occurs .<br>
  Unless I  manage the lock myself (which I dont realy need a synched list for that ) it myself.</p>