Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
3112ac9a
Commit
3112ac9a
authored
Sep 29, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I ran a test, and sharing a pickler, even a fast one, between threads,
is *not* thread-safe. So don't share the Pickler.
parent
cf112582
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
src/ZEO/zrpc/marshal.py
src/ZEO/zrpc/marshal.py
+3
-8
No files found.
src/ZEO/zrpc/marshal.py
View file @
3112ac9a
...
@@ -23,16 +23,11 @@ from ZEO.zrpc.log import log
...
@@ -23,16 +23,11 @@ from ZEO.zrpc.log import log
class
Marshaller
:
class
Marshaller
:
"""Marshal requests and replies to second across network"""
"""Marshal requests and replies to second across network"""
# It's okay to share a single Pickler as long as it's in fast
# mode, which means that it doesn't have a memo.
pickler
=
cPickle
.
Pickler
()
pickler
.
fast
=
1
pickle
=
pickler
.
dump
def
encode
(
self
,
msgid
,
flags
,
name
,
args
):
def
encode
(
self
,
msgid
,
flags
,
name
,
args
):
"""Returns an encoded message"""
"""Returns an encoded message"""
return
self
.
pickle
((
msgid
,
flags
,
name
,
args
),
1
)
pickler
=
cPickle
.
Pickler
()
pickler
.
fast
=
1
return
pickler
.
dump
((
msgid
,
flags
,
name
,
args
),
1
)
def
decode
(
self
,
msg
):
def
decode
(
self
,
msg
):
"""Decodes msg and returns its parts"""
"""Decodes msg and returns its parts"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment