V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Dec 2, 2019 via Android · 3560 views
    This topic created in 2338 days ago, the information mentioned may be changed or developed.
    map
    map+close+join
    map_async
    map_async+close+join
    这四种方式啥区别?如有实例说明最好
    1 replies    2019-12-02 09:31:19 +08:00
    lalalakakaka
        1
    lalalakakaka  
       Dec 2, 2019
    个人经验,有 map 必须要有 close 和 join 关闭线程池,不然会有诡异的内存泄露问题。单独使用 map 可能会出问题也可能没问题,但是最好不要冒险。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1217 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:55 · PVG 01:55 · LAX 10:55 · JFK 13:55
    ♥ Do have faith in what you're doing.