5 ms·
Yes. SharedMemory can share list (https://docs.python.org/3/library/multiprocessing.shared_memory.html#multiprocessing.shared_memory.ShareableList https://docs.
by BiteCode_dev 5y ago
Yes. SharedMemory can share list (https://docs.python.org/3/library/multiprocessing.shared_memory.html#multiprocessing.shared_memory.ShareableList https://docs.python.org/3/library/multiprocessing.shared_mem...) but that's it.
That's why diskscache is better as an alternative for complex objects: https://pypi.org/project/diskcache/ https://pypi.org/project/diskcache/
It's not as good as a simple shared variable, but it's surprisingly performant, since it uses memory-mapped files.
- goldenkey 5y agoI see what you mean. Does diskcache still have to do deserialization of the mapped data? Nested objects (large disparate heap pointer graphs) would suffer performance penalties.
- BiteCode_dev 5y agoIt does yes, although pickle is pretty fast, it's still a penalty.