V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
oldbird
V2EX  ›  Python

多进程 pool 里几个方法的困惑

  •  
  •   oldbird · 2019-12-02 08:08:08 +08:00 via Android · 2835 次点击
    这是一个创建于 1600 天前的主题,其中的信息可能已经有所发展或是发生改变。
    map
    map+close+join
    map_async
    map_async+close+join
    这四种方式啥区别?如有实例说明最好
    1 条回复    2019-12-02 09:31:19 +08:00
    lalalakakaka
        1
    lalalakakaka  
       2019-12-02 09:31:19 +08:00
    个人经验,有 map 必须要有 close 和 join 关闭线程池,不然会有诡异的内存泄露问题。单独使用 map 可能会出问题也可能没问题,但是最好不要冒险。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1206 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 18:11 · PVG 02:11 · LAX 11:11 · JFK 14:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.