java.util.concurrent · java.base · since Java 1.5

CopyOnWriteArrayList

declaration
public class CopyOnWriteArrayList<E>
        implements List<E>, RandomAccess, Cloneable, Serializable

List that copies its backing array on every write: iteration is lock-free over an immutable snapshot. Ideal for read-mostly listener registries; pathological for write-heavy use.

  • Iterators never throw ConcurrentModificationException — they see the snapshot at creation
  • Every add/remove is O(n) allocation + copy