[issue9248] multiprocessing.pool: Proposal: "waitforslot"

Ask Solem report at bugs.python.org
Tue Jul 13 15:47:04 CEST 2010


New submission from Ask Solem <askh at opera.com>:

This patch adds the `waitforslot` argument to apply_async. If set to `True`, apply_async will not return until there is a worker available to process the job.

This is implemented by a semaphore that is released by the result handler whenever a new result is ready. The semaphore is also released
when the supervisor (worker_handler) finds a worker process that has been
unexpectedly terminated.

This is already in use by Celery 2.0, which ships with its own modified version of multiprocessing.pool.

I'm not sure about the name ``waitforslot``, I think I may even hate it, but haven't been able to come up with a better name for it yet.

----------
components: Library (Lib)
messages: 110193
nosy: asksol, jnoller
priority: normal
severity: normal
status: open
title: multiprocessing.pool: Proposal: "waitforslot"
versions: Python 2.6, Python 2.7

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


More information about the Python-bugs-list mailing list