title: Java, remove elements from multiple threads
body: <p>I have multiple threads iterating over a list. All these threads will in the end find a matching element to remove from such list.</p>
  
  <p>To avoid inconsistent states what should I use for the list? Vector? ArrayList? Other?</p>
  
  <p>Here is an example with Vectors. It doesn't give errors but I'm sure it could:</p>
  
  <pre><code>for(int i=0; i&lt;timersVector.size(); i++){
      currTimerThread = timersVector.get(i);
  
      if(currTimerThread.getRowViewTag().equals(parent.getTag())){
          currTimerThread.stopTimer();
          timersVector.remove(i);
          Log.i(tag, "timerVector size: "+timersVector.size());
      }
  }
  </code></pre>
  
  <p>For example, if one thread is entering the loop and size is 10 and right after another thread is removing the element at 5, what would happen to the first one?</p>
  
  <p>Thanks for any help</p>