Yiling-J / theine

high performance in-memory cache
BSD 3-Clause "New" or "Revised" License
364 stars 5 forks source link

Multiple processes sharing the same in-memory cache #22

Closed ddorian closed 9 months ago

ddorian commented 10 months ago

AFAIK nothing exists in Python. Maybe you can configure a shared address space or something and multiple processes be able to share the same cache.

Yiling-J commented 9 months ago

There are some use case of shared memory: UltraDict and Shared Memory Dict. But I think all of them have to serialize object to bytes before sending data to manager, this would add some overheads, and may cause problems. That's could be the reason why shared memory cache is not popular in Python. So instead of hacking something, I think waiting for Python's no-gil multithreading might be a better choice.

ddorian commented 9 months ago

I'll probably use diskcache or a sqlite alternative in the meantime. Feel free to close the issue. Thank you.