V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
simplesslife
V2EX  ›  Python

python 多进程中的 Queue 和 多线程的 Queue 的底层实现是怎样的?

  •  
  •   simplesslife · 2016-08-15 17:56:36 +08:00 · 2958 次点击
    这是一个创建于 2811 天前的主题,其中的信息可能已经有所发展或是发生改变。

    多进程的 Queue 使用的共享内存吗?多线程的 Queue 用的堆? 还有 Pipe

    求解!

    1 条回复    2016-08-15 20:44:28 +08:00
    SErHo
        1
    SErHo  
       2016-08-15 20:44:28 +08:00   ❤️ 1
    多进程用的是 Pipe ,多线程就是堆内存了,有没有其他实现不太清楚:

    [1]: https://hg.python.org/cpython/file/2.7/Lib/multiprocessing/queues.py#l62
    [2]: https://hg.python.org/cpython/file/2.7/Lib/Queue.py#l198
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2865 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:24 · PVG 15:24 · LAX 00:24 · JFK 03:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.