Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the advantage of queues over pipes when communicating between processes?

What would be the advantage(s) (if any) of using 2 Queues over a Pipe to communicate between processes?

I am planning on using the multiprocessing python module.

like image 806
jldupont Avatar asked Feb 16 '10 20:02

jldupont


1 Answers

The big win is that queues are process- and thread- safe. Pipes are not: if two different processes try to read from or write to the same end of a pipe, bad things happen. Queues are also at a somewhat higher level of abstraction than pipes, which may or may not be an advantage in your specific case.

like image 100
John Feminella Avatar answered Oct 22 '22 22:10

John Feminella