首页
注册
登录
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
V2EX
›
Python
python 中的三种 Queue 有什么区别??
chu8129
·
chu8129
·
2016-04-09 11:28:58 +08:00
· 6310 次点击
这是一个创建于 3226 天前的主题,其中的信息可能已经有所发展或是发生改变。
python 中有三种 Queue ;但不是很清楚三个之间的区别;希望了解的大神解释一下:
import Queue
myqueue = Queue.Queue()
from multiprocessing import Queue
myqueue = Queue.Queue()
import multiprocessing
manager=multiprocessing.Manager()
myqueue=manager.Queue()
Queue
import
myqueue
manager
3 条回复
•
2016-04-09 20:42:18 +08:00
1
icedx
2016-04-09 11:37:15 +08:00
1
Queue.Queue 是进程内非阻塞队列
multiprocess.Queue 是跨进程通信队列
前者是各自进程私有, 后者是各子进程共有
2
chu8129
OP
2016-04-09 14:26:19 +08:00
@
icedx
非常感谢;那 manager 那个呢?
3
icedx
2016-04-09 20:42:18 +08:00
@
chu8129
.Manager 是 multiprocessing 的封装 .Manager.Queue 和 Queue, multiprocessing.Queue 没有太大关系
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
3021 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 12:54
·
PVG 20:54
·
LAX 04:54
·
JFK 07:54
Developed with
CodeLauncher
♥ Do have faith in what you're doing.