Issue 25656: multiprocessing.dummy: pool.map hangs on empty list (original) (raw)

Created on 2015-11-18 14:04 by tomer70, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg254844 - (view) Author: Tomer (tomer70) Date: 2015-11-18 14:04
Hi, In multiprocessing.dummy module I noticed when you send a zero-length iterator to pool.map it hang forever, Code example: import urllib2 from multiprocessing.dummy import Pool as ThreadPool def start_multithreading_urlopen(threads_num): pool = ThreadPool(threads_num) results = pool.map(urllib2.urlopen, []) pool.close() pool.join() # hang here print results I think it related to Issue6433 that was fixed on multiprocessing module with simple length check
msg254973 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-11-20 13:05
I am unable to reproduce the behavior you describe using the code you provided. I've tried on both the current Linux Mint release (64-bit) and OS X 10.10 using the current Python 2.7 release (2.7.10). Could you be more specific about what platform you are using and the precise (2.7.?) version of Python? Anything else that might be missing from your example to help us reproduce?
msg255062 - (view) Author: Tomer (tomer70) Date: 2015-11-21 16:50
Thanks for the reply, So first thing I found that I wasn’t working with python 2.7.10 – I updated to 2.7.10 and it fixed the problem. If you are still curious about reproducing the behavior I’m working on windows 7 64 bit and as I said I worked with python 2.7, Thank you.
msg255070 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-11-21 20:26
@tomer70: Thanks for the update and glad to hear that updating to the latest release fixed the issue.
History
Date User Action Args
2022-04-11 14:58:23 admin set github: 69842
2015-11-21 20:26:57 davin set messages: +
2015-11-21 16:52:15 abarry set status: open -> closedresolution: not a bug
2015-11-21 16:50:05 tomer70 set messages: +
2015-11-20 13:05:51 davin set nosy: + davinmessages: +
2015-11-19 21:38:08 tomer70 set nosy: + jnoller, sbt
2015-11-18 14:04:58 tomer70 create