The Java Concurrency API provides two kinds of concurrent data structures:
- Blocking data structures: This kind of data structure provides methods to insert and delete data on it that, when the operation cannot be done immediately (for example, you want to take an element and the data structure is empty), the thread that made the call will be blocked until the operation can be done
- Non-blocking data structures: This kind of data structure provides methods to insert and delete data on it that, when the operation cannot be done immediately, returns a special value or throws an exception
Sometimes, we have a non-blocking equivalent for the blocking data structure. For example, the ConcurrentLinkedDeque ...