0

I'm attempting to do some real-time (sort-of-ish) web-cam video processing. In order to both grab all the frames and process them, I'm running my frame grabber and image processor as two separate processes. In order to have them communicate I'm trying to decide between using python 2.7's multiprocessing.queue and multiprocessing.pipe.

I don't understand the difference between these two classes. One uses put and get to share data. The other uses send and receive. Is there a use-case where one would prefer on method over the other? Should I prefer one method over the other?

1
  • A pipe is a two-way street, a means of communication. A queue is just a pile of items to add to or take from. Commented Dec 26, 2018 at 17:17

1 Answer 1

0

The multiprocessing.queue is First In First Out (FIFO) queue. You would use this for one-way communication. For example, your grabber process can put() frames onto the queue and the processing process can get() frames from the queue when it's ready to process them.

The multiprocessing.pipe is a 2-way channel and probably doesn't fit your use case. However, if you had 2 processes which were both sending and receiving data between each other you would use the two connection objects where process A sends() on one object and recieves() on the other object and process B does the inverse.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.