# Can dicts be threadsafe?

**URL:** <https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172>\
**Category:** General Usage\
**Tags:** multithreading\
**Created:** [August 5, 2019, 11:07am UTC](https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172 "2019-08-05T11:07:31Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [August 5, 2019, 9:47pm UTC](https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172/6 "2019-08-05T21:47:59Z")

</div>

Basic data structures are not and probably never will be threadsafe—it introduces way too much overhead when you don’t need thread safety. If you want to safely share a dict between threads, you can use a lock, or better still, take a page out of Go’s playbook and have a single task which manages the dict and let other tasks send it messages to tell it to update the dict instead.

---

_[View the full topic](https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172)._
