classification
Title: multiprocessing.Pool: Need a way to find out if work are finished.
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: guilherme-pg, jnoller, mozbugbox, petri.lehtinen
Priority: normal Keywords: easy, patch

Created on 2011-06-09 13:59 by mozbugbox, last changed 2012-03-14 18:27 by guilherme-pg.

Files
File name Uploaded Description Edit
12294.patch guilherme-pg, 2012-03-14 18:27 review
Messages (2)
msg137970 - (view) Author: Bugs Fly (mozbugbox) Date: 2011-06-09 13:59
The join() method of Pool blocks. So it is not good for finding out if there are still running workers once the pool is closed.

There should be a method like is_alive() which don't block, similar to what in Process. Or task_left() which return number of task left.
msg155780 - (view) Author: Guilherme Gonçalves (guilherme-pg) Date: 2012-03-14 18:27
I uploaded a patch that adds an is_alive() method to multiprocessing.Pool, along with the associated test and documentation updates.

Please let me know if there are any issues, I'll be glad to rework the patch.
History
Date User Action Args
2012-03-14 18:27:04guilherme-pgsetfiles: + 12294.patch

nosy: + guilherme-pg
messages: + msg155780

keywords: + patch
2011-07-27 10:41:30petri.lehtinensetkeywords: + easy
nosy: + jnoller

stage: test needed -> needs patch
2011-07-24 17:55:44petri.lehtinensetstage: test needed
2011-06-13 13:19:08petri.lehtinensetnosy: + petri.lehtinen

versions: + Python 3.3
2011-06-09 13:59:51mozbugboxcreate