Giving a running process a different queue

In multiprocessing, if I want to have a Process be aware of a queue it can use after it has started, do I need to use SyncManager.Queue and send it via a queue/pipe? There’s no other way?

Hi Stephen,

I think, the best way might indeed be to use a

multiprocessing.Manager()

to share objects alike queues between two or more processes :slight_smile:

At least, if you want the code to be platform independent - as shared memory works differently for Windows and Linux…

Alternatively, you could setup and handle pipes ‘manually’, but I do not see an advantage in that. On the contrary.

Cheers, Dominik

PS: I hope, I did not misunderstood you, as I do not know, what you mean with sending a queue via a pipe?? The queue created using the manager simply is given as a parameter to the constructor of the process, right? The rest is done by the manager…

Have a look at this example: