ConcurrentCollections.jl provides the following concurrent collections for Julia ≥ 1.7. Most of their operations are (almost) lock-free whenever appropriate.
DualLinkedConcurrentRingQueue
DualLinkedQueue
LinkedConcurrentRingQueue
ConcurrentQueue
ConcurrentStack
WorkStealingDeque
ConcurrentDict
NOTE: If you are trying to find a way to improve performance (especially
the throughput) of your program, it is highly recommended to look for ways to
avoid using concurrent collections first. In particular, consider applying
the data-parallel pattern to
dodge the difficulties in concurrent programming. For example, it is often a
better idea to use task-local non-thread-safe Dict
s instead of a
ConcurrentDict
shared across tasks. One of the most important techniques in
data-parallel programming is how to merge such task-local states. For more
information, see, e.g., Efficient and safe approaches to mutation in data
parallelism.