Sye van der Veen <[email protected]> added the comment:
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.
----------
nosy: +syeberman
versions: +Python 2.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12488>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com