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 Pool deadlocks on join after empty map operation
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Jimbofbx, jeffknupp, sbt
Priority: normal Keywords:

Created on 2012-08-16 20:41 by Jimbofbx, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg168408 - (view) Author: James Hutchison (Jimbofbx) Date: 2012-08-16 20:41
Following code deadlocks on Windows 7 64-bit, Python 3.2.3

If you have a pool issue a map operation over an empty iterable then try to join later, it will deadlock. If there is no map operation or blah in the code below isn't empty, it does not deadlock

from multiprocessing import Pool

def main():
    p = Pool();
    blah = [];
    print("Mapping");
    p.map(dummy, blah);
    p.close();
    p.join(); # deadlocks here
    print("Done");

def dummy(x):
    pass;

if __name__ == "__main__":
    main();
msg168414 - (view) Author: Jeff Knupp (jeffknupp) * Date: 2012-08-16 21:16
This is a duplicate of http://bugs.python.org/issue12157, which was fixed.
History
Date User Action Args
2022-04-11 14:57:34adminsetgithub: 59907
2012-08-17 11:17:37sbtsetstatus: open -> closed
resolution: duplicate
stage: resolved
2012-08-16 21:16:03jeffknuppsetnosy: + jeffknupp
messages: + msg168414
2012-08-16 20:57:36pitrousetnosy: + sbt
2012-08-16 20:41:47Jimbofbxcreate