[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

Andreas van Cranenburgh report at bugs.python.org
Sun May 4 01:38:08 CEST 2014


New submission from Andreas van Cranenburgh:

It would be useful if concurrent.futures.ThreadPoolExecutor took an initializer argument, like multiprocessing.Pool.

This is useful for example to load a large dataset once upon initialization of each worker process, without have to pass the dataset as an argument with every job submission, which requires serialization.

concurrent.futures has some advantages over multiprocessing such as detecting killed processes ( http://bugs.python.org/issue9205 ), so it would be good if the advantages of both can be combined.

It appears that the following fork of concurrent.futures has added these arguments: https://github.com/enthought/encore/blob/7101984bc384da8e7975876ca2809cc0103c3efc/encore/concurrent/futures/enhanced_thread_pool_executor.py

----------
components: Library (Lib)
messages: 217846
nosy: andreasvc
priority: normal
severity: normal
status: open
title: concurrent.futures.ThreadPoolExecutor should accept an initializer argument
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21423>
_______________________________________


More information about the Python-bugs-list mailing list