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

multiprocessing 怎么保证进程数一直不变?

  •  
  •   displayabc · Oct 13, 2014 · 3615 views
    This topic created in 4366 days ago, the information mentioned may be changed or developed.
    使用multiprocessing起多个进程,我担心有进程会挂掉,怎么防止进程挂掉,或者能检测到有进程挂掉,再起一个。注:fork的方式启动我知道如何检测,但是我想用multiprocessing
    2 replies  •  2014-10-14 09:03:05 +08:00
    lushl9301
        1
    lushl9301  
       Oct 13, 2014
    main thread 一直loop?检测每个进程?
    mengzhuo
        2
    mengzhuo  
       Oct 14, 2014
    multiprocessing就是用os.fork,只是加了一些管理用的
    https://hg.python.org/cpython/file/d894aa49d5e4/Lib/multiprocessing/popen_fork.py#l70
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2701 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:50 · PVG 15:50 · LAX 00:50 · JFK 03:50
    ♥ Do have faith in what you're doing.