classification
Title: Multiprocessing Pool deadlocks on join after empty map operation
Type: behavior Stage: committed/rejected
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 2012-08-17 11:17 by sbt. 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
2012-08-17 11:17:37sbtsetstatus: open -> closed
resolution: duplicate
stage: committed/rejected
2012-08-16 21:16:03jeffknuppsetnosy: + jeffknupp
messages: + msg168414
2012-08-16 20:57:36pitrousetnosy: + sbt
2012-08-16 20:41:47Jimbofbxcreate