# Duplexing Pipes/Queues

**URL:** <https://discuss.python.org/t/duplexing-pipes-queues/34310>\
**Category:** Python Help\
**Created:** [September 21, 2023, 1:16pm UTC](https://discuss.python.org/t/duplexing-pipes-queues/34310 "2023-09-21T13:16:36Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![hansgeunsmeyer](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hansgeunsmeyer/32/15188_2.png) [@hansgeunsmeyer](https://discuss.python.org/u/hansgeunsmeyer)\
**Post date:** [September 23, 2023, 9:49pm UTC](https://discuss.python.org/t/duplexing-pipes-queues/34310/13 "2023-09-23T21:49:30Z")

</div>

> [@Robin66](#):
>
> I need a ping pong algo because of this:
> 
> > [@Robin66](#):
> >
> > So then I switched to a single Queue, but found that the sender would dequeue its own object before the other process had a chance to Queue.get() it. So to avoid that I’ve got 2 Queues.

That’s exactly what I don’t understand. Why is the sender putting an object on its own queue of incoming messages? If you have 2 processes, then imo each would need to have its own (non-shared) queue of incoming messages (so the queue would be an internal implementation detail of that process, it doesn’t have to be known outside). Using two _shared_ queues doesn’t make sense to me here, since then yes, you’re losing all the advantages of asynchronous processing and forcing the processes to walk in a ping-pong lockstep… Or am I still missing sth?

Btw - as an aside – just to show you that queue usage and design is not trivial even for the best among us, you might find this thread interesting: [Queue termination](https://discuss.python.org/t/queue-termination/18386)🙂

---

_[View the full topic](https://discuss.python.org/t/duplexing-pipes-queues/34310)._
