Message159282
| Author |
syeberman |
| Recipients |
docs@python, lcampagn, neologix, pitrou, syeberman |
| Date |
2012年04月25日.13:25:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1335360355.78.0.244713171331.issue12488@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|