I have two python classes that share a base class that let's say defines a multiprocessing.Queue.
Each of those classes will be launched on a separate subprocess and need to share info through a queue.
Now, if the base class defines a Queue, then each subclass object will instantiate it's own queue, making the sharing of queue elements impossible. But then again I find this documented
Queue objects should only be shared between processes through inheritance.
So what's the proper way of sharing a Queue between subprocesses and how does the above sentence even make sense?
Note that I can obviously pass a reference to the queue at initialization of the subprocesses but I'd like to takle this problem using inheritance
So what's the proper way of sharing a Queue between subprocesses and how does the above sentence even make sense?
The sentence makes sense when you are talking about inheritance between processes, like child and parent processes. It is NOT about classes and inheritance in Object Oriented Programming.
For the proper way of using queues, look at this or this for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With