I am fairly new to multiprocessing in python. I am trying to use Queues to pass messages between processes. As I read through the documentation it says multiprocessing.Queue() is thread and process safe. But it doesn't say whether multiprocessing.Manager.Queue() is thread and process safe. Under the hood it uses native Queue class so I am not sure if it is process safe. Could someone clarify this?
Asked
Active
Viewed 332 times
0
-
1Yes it is. Manager queue is simply a queue running in another process which you have access to. – Charchit Agarwal Jul 10 '22 at 15:51
-
`multiprocessing.Manager` is an RPC mechanism. One side gets a proxy to the object on the other side. You call `my_queue.put(whatever)`, for instance, and the RPC forwards the data to a manager server on the other side that makes the call. The RPC is thread safe and the object on the other side is thread safe. – tdelaney Jul 10 '22 at 16:17