Concurrent data structures
A concurrent data structure, is a data structure (e.g. list, stack) that can be used by multiple threads concurently and it will always show a consistent state to each thread.
Consistency
The definition above mentions that the data structure will always show a consistent state. To understand this, let’s analyze a data structure that is not concurrent and can end in an inconsistent state.
Let’s say we are building an application that draws a single rectangle. The dimensions of this rectangle can be modified by users around the world, they just need to visit a website and enter the new dimensions.