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
hhrmatata
V2EX  ›  Python

python 3 对多进程的支持好吗?

  •  
  •   hhrmatata · Jan 22, 2016 · 3856 views
    This topic created in 3752 days ago, the information mentioned may be changed or developed.
    都知道 python 2 的多进程是伪多进程,请问 python 3 有没有改观?
    6 replies    2016-01-25 11:24:07 +08:00
    jimzhong
        1
    jimzhong  
       Jan 22, 2016
    你说的是多线程吧,好像没有改观。
    hhrmatata
        2
    hhrmatata  
    OP
       Jan 22, 2016
    @jimzhong 恩,对,我说错了,是多线程
    fy
        3
    fy  
       Jan 22, 2016
    和原来一样:
    看类型,计算密集型还是那样,多线程等于没有。
    但是 IO 等待型,多线程有效。
    ericls
        4
    ericls  
       Jan 23, 2016
    Python 3 多线程还是有 GIL 啊

    另外 Python 2 的多线程是 native 的多线程,某种意义上说 是 真 多线程!

    多进程和协程 还是很好用的 没遇到什么大的问题

    最大的问题是,很多库都没有兼容 asyncio 的代替
    RqPS6rhmP3Nyn3Tm
        5
    RqPS6rhmP3Nyn3Tm  
       Jan 23, 2016
    多线程至少我用下来没啥改观, CPU 0 依然 100%,剩下的在睡觉……
    lixiaohan
        6
    lixiaohan  
       Jan 25, 2016
    有 GIL 就不要想多线程了 用多进程和协程
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 18:45 · PVG 02:45 · LAX 11:45 · JFK 14:45
    ♥ Do have faith in what you're doing.