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

for 循环几千次做简单的计算任务算不算计算密集型任务?

  •  
  •   shade · Aug 8, 2014 · 4010 views
    This topic created in 4469 days ago, the information mentioned may be changed or developed.
    5 replies  •  2014-08-08 19:20:29 +08:00
    dong3580
    dong3580
    Aug 8, 2014
    1
    表示已经死循环了好几个月,服务器依然正常ing。。。几千次怕啥,
    shade
    shade
    OP
    Aug 8, 2014❤️1
    2
    在gevent碰到这种问题,会直接跑死,怎样在gevent中处理cpu-bound任务呢?
    hydrazt
    hydrazt
    Aug 8, 2014
    3
    gevent处理io-bound,cpu-bound没必要gevent吧
    Mutoo
    Mutoo
    Aug 8, 2014
    4
    又不是 O(n^k), k>2 怕啥
    Glow
    Glow
    Aug 8, 2014❤️1
    5
    可以试一试 Duff's Device 来优化一下

    Duff's device - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Duff's_device
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1369 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:12 · PVG 06:12 · LAX 14:12 · JFK 17:12
    ♥ Do have faith in what you're doing.