Message159282
This issue _does_ exist on Windows, and is not limited to the case where the master process exits before its children. The following code, which is almost exactly that from the 2.7.3 documentation, deadlocks on Win7 (Py3.2 and 2.7) and WinXP (Py3.2 and 2.6):
from multiprocessing import Process, Pipe
import sys
def f(conn):
#conn.send([42, None, 'hello']) # uncomment second
conn.close()
if __name__ == "__main__":
parent_conn, child_conn = Pipe()
p = Process(target=f, args=(child_conn,))
p.start()
#child_conn.close() # uncomment first
sys.stdout.write( "about to receive\n" )
sys.stdout.write( "%s\n"%parent_conn.recv() )
sys.stdout.write( "received\n" )
p.join()
If you "uncomment first", recv raises an EOFError; if you also "uncomment second", recv succeeds.
If this behaviour is the same on other platforms, then it seems all that is required is to update the documentation. |
|
Date |
User |
Action |
Args |
2012-04-25 13:25:55 | syeberman | set | recipients:
+ syeberman, pitrou, neologix, docs@python, lcampagn |
2012-04-25 13:25:55 | syeberman | set | messageid: <1335360355.78.0.244713171331.issue12488@psf.upfronthosting.co.za> |
2012-04-25 13:25:55 | syeberman | link | issue12488 messages |
2012-04-25 13:25:54 | syeberman | create | |
|