# ConcurrentCollections.jl: "lock-free" dictionary, queue, etc. for Julia 1.7

**URL:** https://discourse.julialang.org/t/concurrentcollections-jl-lock-free-dictionary-queue-etc-for-julia-1-7/72501
**Category:** Package Announcements
**Tags:** multithreading
**Created:** [December 3, 2021, 3:37am UTC](https://discourse.julialang.org/t/concurrentcollections-jl-lock-free-dictionary-queue-etc-for-julia-1-7/72501 "2021-12-03T03:37:18Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)
#### Post date: [December 3, 2021, 5:58am UTC](https://discourse.julialang.org/t/concurrentcollections-jl-lock-free-dictionary-queue-etc-for-julia-1-7/72501/3 "2021-12-03T05:58:07Z")

</div>

I don’t think there’s any established guideline. I just used what _I_ thought least confusing (i.e., treating `Union{Some,Nothing}` as a maybe value). But, in fact, there are a few recent discussions in Julia around this

- [https://github.com/JuliaLang/julia/pull/34821](https://github.com/JuliaLang/julia/pull/34821)
- [https://github.com/JuliaLang/julia/pull/41966](https://github.com/JuliaLang/julia/pull/41966)

It’s also nice to go beyond the “maybe” APIs. When you use concurrent data structures, it’d be nice to have a low-level API that tells you why certain operations failed (empty collection? contention? locked?). Throwing an exception is too slow in a tight loop but there’s no established convention for the success/error sum type. There are ErrorTypes.jl, ResultTypes.jl, and Expect.jl but, IIRC, none of them seem to try to exploit union-split capability in Julia which is rather unfortunate (although there are of course legit reasons why you don’t want to use `Union`). Ref: [[ANN] ErrorTypes.jl - Rust-like safe errors in Julia](https://discourse.julialang.org/t/ann-errortypes-jl-rust-like-safe-errors-in-julia/53953)

---

_[View the full topic](https://discourse.julialang.org/t/concurrentcollections-jl-lock-free-dictionary-queue-etc-for-julia-1-7/72501)._
