Pool workers do not complete all tasks

三世轮回 提交于 2019-12-05 20:51:42

[EDIT] The issue which you're seeing is because of this code:

self.results = self.results.append(...)

this isn't atomic. So in some cases, the thread will be interrupted after reading self.results (or while appending) but before it can assign the new frame to self.results -> this instance will be lost.

The correct solution is to wait use the results objects to get the results and then append all of them in the main thread.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!