python中多进程下通信使用管道Pipe与队列 Queue 的区别: Multiprocessing - Pipe vs Queue
参考:
https://stackoverflow.com/questions/8463008/multiprocessing-pipe-vs-queue
=========================================================
区别:
When to use them
If you need more than two points to communicate, use a Queue()
.
If you need absolute performance, a Pipe()
is much faster because Queue()
is built on top of Pipe()
.
------------
结论:
In summary Pipe()
is about three times faster than a Queue()
.
Queue 的底层是使用Pipe来实现的,或者说Queue是对Pipe的进一步包装,所以性能上有所下降,按照上面的参考资料显示速度降为了Pipe的3分之一,但是Queue支持的功能更加广泛,所以使用Pipe还是Queue要综合考虑性能要求及功能需求。
本博客是博主个人学习时的一些记录,不保证是为原创,个别文章加入了转载的源地址,还有个别文章是汇总网上多份资料所成,在这之中也必有疏漏未加标注处,如有侵权请与博主联系。
如果未特殊标注则为原创,遵循 CC 4.0 BY-SA 版权协议。
posted on 2021-07-29 11:41 Angry_Panda 阅读(390) 评论(0) 收藏 举报