[issue11875] OrderedDict.__reduce__ not threadsafe

Raymond Hettinger report at bugs.python.org
Tue Apr 19 21:08:53 CEST 2011


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Mario, I removed the unnecessary mutation, but remember that OrderedDict's are not thread-safe in general.  Anything that updates an OrderedDict will temporarily leave it in an inconsistent state while the links and mappings are being updated.  

That being said, it isn't hard to create a subclass with a lock around each of the mutating methods: setitem, delitem, clear, popitem, pop, move_to_end, setdefault, init, and update.

----------
resolution:  -> fixed
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11875>
_______________________________________


More information about the Python-bugs-list mailing list