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

多进程应该使用多个 Queue 通信吗

  •  
  •   kingname ·
    kingname · Apr 24, 2015 · 2536 views
    This topic created in 4181 days ago, the information mentioned may be changed or developed.
    我在使用mutiprocess的Process生成了几个不同的子进程,现在使用Queue通信。由于不同的进程之间传递的信息不同,因此我使用了多个Queue。这种方式运行起来功能上是没有问题的,但是我想请问,在Python的编码规范中,这样写是否合适?会不会有什么隐患?
    1 replies  •  2015-04-25 00:46:36 +08:00
    R4rvZ6agNVWr56V0
        1
    R4rvZ6agNVWr56V0  
       Apr 25, 2015   ❤️ 1
    “由于不同的进程之间传递的信息不同,因此我使用了多个Queue” 不是很理解你为什么这样做。但这跟Python编码规范没关系的。可以传多个multiprocessing.Queue()实例的。协调好生产者和消费者即可,之外没啥隐患。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2352 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 14:54 · PVG 22:54 · LAX 07:54 · JFK 10:54
    ♥ Do have faith in what you're doing.