IT lexicon › Programming › Concurrent modification

Concurrent modification

Programming På svenska → Updated: 2026-11-15

The problem of one thread reading from a data structure while another writes to it, causing undefined behavior.

Concurrent modification is more common than it sounds — iterating over a list while another thread adds elements is a textbook example. Many standard library collections (C++ STL, Java Collections Framework) are explicitly not thread-safe. Solutions include: mutexes, read-write locks, copy-on-write, or lock-free data structures. Some languages like Go make it a compile error; others leave it to the programmer.

← Back to the lexicon