只是multiprocessing的使用例子,不建议使用多进程的方式,进行并发。最好的方法。是1个进程N个线程的方式(使用的模块是thread和multiprocessing)
)#同时打印几个结果
pool.close()#执行完close后不会有新的进程加入到pool,join函数等待所有子进程结束
pool.join()#等待进程运行完毕,先调用close函数,否则会出错
#进程的执行结果;从result中读出来打印结果
for res in result:
a = res.get()
print a

相关文章:

  • 2022-03-08
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
相关资源
相似解决方案