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

运行 python 的时候为什么出现了 cpu 使用超过 100%的情况?

  •  
  •   ShiehShieh ·
    ShiehShieh · Jan 31, 2015 · 8570 views
    This topic created in 4255 days ago, the information mentioned may be changed or developed.

    显示有四个核在跑python,python不是一般使用时无法动用多核优势的么?
    我使用了gevent,用coroutine在运行,但是coroutine按常理不是单核单线程上运行的么?
    问什么会出现cpu120%的使用率?

    6 replies  •  2015-02-01 00:44:26 +08:00
    zerh925
        1
    zerh925  
       Jan 31, 2015
    multiprocessing就可以跑在多核上面。
    ShiehShieh
        2
    ShiehShieh  
    OP
       Jan 31, 2015
    我知道python可以利用多核,我的问题是,我没有使用多进程,我用的是协程,但是出现了上述情况。
    regex
        3
    regex  
       Jan 31, 2015
    有些比较imba的库 如lxml 已经去除了GIL
    binux
        4
    binux  
       Feb 1, 2015
    可能性太多,信息不足
    ShiehShieh
        5
    ShiehShieh  
    OP
       Feb 1, 2015
    使用了beautifulsoup4, request, greenlet, gevent(使用了monky patch).
    EPr2hh6LADQWqRVH
        6
    EPr2hh6LADQWqRVH  
       Feb 1, 2015
    c代码的部分在同时运行吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 19:42 · PVG 03:42 · LAX 12:42 · JFK 15:42
    ♥ Do have faith in what you're doing.