Reputation: 20440
I know there is a Value type could allocate shared memory, but seems it could only contains basic c types.
Is there anyway allow us to pass complex data types like Queue/Map between processes ?
Upvotes: 0
Views: 2654
Reputation: 179402
Use Managers. Create a Manager object, then invoke manager.Queue (for example) to create a sharable Queue proxy. You can then pickle the returned proxy object and pass that between processes.
Manager
manager.Queue
Queue
Upvotes: 1