Commit 7812454c authored by Guido van Rossum's avatar Guido van Rossum

Add a comment explaining that sharing a pickler is not thread-safe.

No jokes about sharing pickles please. :-)
parent 3112ac9a
......@@ -25,6 +25,7 @@ class Marshaller:
def encode(self, msgid, flags, name, args):
"""Returns an encoded message"""
# (We used to have a global pickler, but that's not thread-safe. :-( )
pickler = cPickle.Pickler()
pickler.fast = 1
return pickler.dump((msgid, flags, name, args), 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment