推荐学习书目
› 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
soulmine
V2EX  ›  Python

python 下有什么好用的多进程并发框架么

  •  
  •   soulmine · Oct 18, 2016 · 5603 views
    This topic created in 3687 days ago, the information mentioned may be changed or developed.
    写了个爬虫 但只是单进程的 想开多进程 具体要求就是可以自动协商不重复 不要开 100 个进程 回头输出了 100 份完全一样的结果
    12 replies  •  2016-10-18 12:12:07 +08:00
    Livid
    Livid
    MOD
    PRO
    Oct 18, 2016❤️1
    1
    soulmine
    soulmine
    OP
    Oct 18, 2016
    2
    @Livid 谢谢 我去看看 doc
    ericls
    ericls
    Oct 18, 2016 via iPhone
    3
    asyncio
    clino
    clino
    Oct 18, 2016
    4
    也可以用协程吧,如果非 cpu 密集型的话
    9hills
    9hills
    Oct 18, 2016
    5
    multiprocess 就行
    soulmine
    soulmine
    OP
    Oct 18, 2016
    6
    @9hills 这要在爬虫里面写啊 懒得去写 multiprocessing
    soulmine
    soulmine
    OP
    Oct 18, 2016
    7
    @clino 只要能满足条件 其实无所谓的 爬虫肯定是受限于网络和 Io 的问题
    soulmine
    soulmine
    OP
    Oct 18, 2016
    8
    @ericls 然而我用的 2.7....
    Nostalgia
    Nostalgia
    Oct 18, 2016
    9
    推荐 concurrent.futures ,支持多进程 /多线程,且封装的接口一致;抽象的程度比 threading, multiprocessing 更高些。
    ericls
    ericls
    Oct 18, 2016 via iPhone
    10
    asyncio 有 back port 吧

    另外楼上说的 promise 写起来也挺舒服的


    要注意 process pool executor 必须要 picklable
    shyling
    shyling
    Oct 18, 2016
    11
    concurrent.futures , MultiThreadPool
    reyno
    reyno
    Oct 18, 2016 via iPhone
    12
    直接上 gevent
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1660 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 16:11 · PVG 00:11 · LAX 08:11 · JFK 11:11
    ♥ Do have faith in what you're doing.