1 from multiprocessing import Process,Queue,Pipe
 2 import os
 3 def f(q):
 4 #    q.send([42,None,'hello'])
 5     print('This is child_conn ....' % q.recv())
 6 #    q.close()
 7     print 'Os getpid is %s...' % os.getpid()
 8 
 9 if __name__=='__main__':
10     parent_conn,child_conn=Pipe()
11     parent_conn.send(['good',None,100])
12     p=Process(target=f,args=(child_conn,))
13     p.start()
14     print(parent_conn.recv())
15     parent_conn.close()
16     p.join()

?f(q)内的作为child_conn的q为什么接收不到parent_conn的推送

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-10-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2021-05-18
  • 2022-12-23
  • 2022-01-01
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案