> Here's an implementation of the idea posted on python-ideas
> (http://mail.python.org/pipermail/python-ideas/2013-January/018846.html).
>
> The principle is really simple, we just serialize/unserialize the
> objects before/after holding the locks. This leads to reduced
> contention.
I would like to suggest again my idea of doing it in Connection instead,
with new methods (e.g. locked_send and locked_recv). Especially given
it can be useful in user code to have a thread-safe Connection (I'm in
this situation currently).