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.ThreadPool.join() blocks indefinitely.
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty
View: 12157
Assigned To: Nosy List: Ben.Timby, neologix, rosslagerwall
Priority: normal Keywords:

Created on 2012-02-03 21:29 by Ben.Timby, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg152566 - (view) Author: Ben Timby (Ben.Timby) Date: 2012-02-03 21:29
If you instantiate a ThreadPool, then call map() with an empty list, the join() method will block indefinitely on self._result_handler.join()

$ python
> from multiprocessing.pool import ThreadPool
> t = ThreadPool(1)
> t.map_async(lambda x: x, [])
> t.close()
> t.join()  # <- never returns

I was not able to determine the root cause, however, I found that the join() blocks when joining the _result_handler thread.
msg152606 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2012-02-04 10:33
It's a duplicate of issue #12157.
History
Date User Action Args
2022-04-11 14:57:26adminsetgithub: 58145
2012-02-04 10:33:59neologixsetstatus: open -> closed

superseder: join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty
versions: + Python 3.2, Python 3.3
nosy: + neologix

messages: + msg152606
resolution: duplicate
stage: resolved
2012-02-04 06:17:51rosslagerwallsetnosy: + rosslagerwall
2012-02-03 21:29:22Ben.Timbycreate