This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Multiprocessing.pool API Extension - Pass Data to Workers w/o Globals
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: davin, pitrou, seanharr11, terry.reedy
Priority: normal Keywords: patch

Created on 2018-09-28 20:04 by seanharr11, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 9627 open seanharr11, 2018-09-28 20:14
Messages (2)
msg327168 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-10-05 18:45
Quoting the PR:

Proposing a new kwarg in the __init__() method of multiprocessing.Pool named expect_initret.

This kwarg defaults to False. When set to True, the return value of the initializer function is passed to the function we are applying (i.e. func in Pool.map(func, ls)), as a kwarg named initret.

This PR includes thorough test coverage, and provides backwards compatibility (at least in Python3.x).

See blog post
https://thelaziestprogrammer.com/python/multiprocessing-pool-expect-initret-proposal
for example use cases, as well as an initial defense for why this makes the multiprocessing.Pool API more approachable, to more Python end-users, and augments the library.
msg327169 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-10-05 18:45
New features only go in next version.
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 79018
2018-10-05 18:45:39terry.reedysetmessages: + msg327169
versions: - Python 3.6, Python 3.7
2018-10-05 18:45:08terry.reedysetnosy: + terry.reedy, pitrou, davin
messages: + msg327168
2018-09-28 20:53:06seanharr11settitle: Multiprocessing.pool API Extension - Non-Global Initialization of Workers -> Multiprocessing.pool API Extension - Pass Data to Workers w/o Globals
2018-09-28 20:14:17seanharr11setkeywords: + patch
stage: patch review
pull_requests: + pull_request9025
2018-09-28 20:04:13seanharr11create