当我试图用20个线程通过asyncio和同期期货python3.4中的模块。它出现后,像2-5分钟脚本工作。在
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Task exception was never retrieved
future: <Task finished coro=<main() done, defined at async.py:173> exception=BrokenProcessPool('A process in the process pool was terminated abruptly while the future was running or pending.',)>
我试图优化我的代码,但是仍然遇到了这个错误,这是前面描述的。在
代码:
^{pr2}$
在
loop.close()
之后添加p.shutdown()
,等待完成所有执行的任务。在相关问题 更多 >
编程相关推荐