classification
Title: parameterize what serialization is used in multiprocessing
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: davin Nosy List: davin, eric.snow, python-dev
Priority: normal Keywords: patch

Created on 2016-09-09 20:58 by davin, last changed 2017-05-19 00:45 by davin.

Files
File name Uploaded Description Edit
issue_28053_missingdocs.patch davin, 2016-09-09 21:52 Patch but missing docs review
Messages (5)
msg275437 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2016-09-09 20:58
Currently multiprocessing uses the pickle module for its serialization of objects to be communicated between processes.  Specifically v2 of the pickle protocols is now exclusively used to provide maximum compatibility, motivated by the desire for multiple versions of Python to be used simultaneously with multiprocessing.

Per conversations in issue26507, issue23403, and others, multiprocessing should offer the option to specify what serialization is to be used for the transport of data between processes.  Besides supporting requests to use a different version of the pickle protocol or using 3rd party tools like dill, a hook to specify the means for reducing objects to a transmittable form opens a door for other creative or higher performance strategies.

Ultimately, this is not an enhancement to add functionality but rather to reorganize the existing internals of multiprocessing to permit better control over its use of serialization.
msg275459 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2016-09-09 21:52
Attaching patch containing refactorizations but missing update to docs for the purposes of review.

Introduces three new things:
* a function to get the current serializer/reducer
* a function to set the serializer/reducer
* an abstract base class to assist others in rolling their own reducers
msg275479 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2016-09-09 22:39
LGTM
msg275486 - (view) Author: Roundup Robot (python-dev) Date: 2016-09-09 23:03
New changeset 7381b1b50e00 by Davin Potts in branch 'default':
Issue #28053: Applying refactorings, docs and other cleanup to follow.
https://hg.python.org/cpython/rev/7381b1b50e00
msg293947 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2017-05-19 00:45
Docs need updating still.
History
Date User Action Args
2017-05-19 00:45:07davinsetmessages: + msg293947
versions: + Python 3.7
2016-09-09 23:03:29python-devsetnosy: + python-dev
messages: + msg275486
2016-09-09 22:39:20eric.snowsetmessages: + msg275479
2016-09-09 21:52:58davinsetfiles: + issue_28053_missingdocs.patch

nosy: + eric.snow
messages: + msg275459

keywords: + patch
stage: patch review
2016-09-09 21:04:52davinlinkissue23403 superseder
2016-09-09 21:02:12davinlinkissue26507 superseder
2016-09-09 21:00:49davinsetcomponents: + Library (Lib)
2016-09-09 20:58:54davincreate