[Python-Dev] [RFC] Removing pure Python implementation of OrderedDict
Antoine Pitrou
solipsis at pitrou.net
Wed Sep 6 06:09:05 EDT 2017
On Wed, 6 Sep 2017 11:26:52 +0900
INADA Naoki <songofacandy at gmail.com> wrote:
>
> Like that, should we say "atomic & threadsafe __setitem__ for simple
> key is implementation detail of CPython and PyPy. We recommend
> using mutex when using OrderedDict from multiple thread."?
I think you may be overstating the importance of making OrderedDict
thread-safe. It's quite rare to be able to rely on the thread safety
of a single structure, since most often your state is more complex than
that and you have to use a lock anyway.
The statu quo is that only experts rely on the thread-safety of list
and dict, and they should be ready to reconsider if some day the
guarantees change.
Regards
Antoine.
More information about the Python-Dev
mailing list