【问题标题】:python Multiprocessing and maxtasksperchildpython多处理和maxtasksperchild
【发布时间】:2016-03-01 21:58:57
【问题描述】:

最近我一直在玩多处理模块。我更新了最后一个版本,我意识到 Pypi 中的最后一个版本有与文档不匹配的新代码。

具体来说,创建Pool并没有maxtasksperchild选项,认为按照文档,是python2.7上的新集成

https://docs.python.org/2/library/multiprocessing.html#module-multiprocessing.pool

检查新模块说多处理模块的版本是 2.6.2.1 如果这是真的,而且这个论点是正确的,那么我们现在如何确保新进程将释放所有内存?这是我使用这个论点的主要兴趣。查看代码我还没有找到任何东西,但我仍在寻找。

谢谢

【问题讨论】:

  • multiprocessing 模块是标准库的一部分。如果您获得的是外部版本,那么它可能已经过时并且已经过时(并且打算在更旧版本的 Python 上使用)。

标签: python python-multiprocessing


【解决方案1】:

来自Pypi's multiprocessing page

“将多处理包向后移植到 Python 2.4 和 2.5”。

您应该只将它与较旧的 python 版本一起使用。在 python > 2.7 上,多处理是一个不需要安装的内置模块。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-20
    • 2021-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多