且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python多重处理永远不会加入

更新时间:2023-12-04 23:25:10

我确实没有答案,但是我阅读了Apply_async的文档,似乎与您提出的问题背道而驰...

I don't really have an answer but I read the docs for Apply_async and it seems counter to your stated problem...

回调应立即完成,因为否则该线程将 处理结果将被阻止.

Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.

我不熟悉Pool,但在我看来,您可以通过

I'm not familiar with the Pool but it seems to me that your use-case could easily be handled by this recipe on Python Module of the Week