qrand icon indicating copy to clipboard operation
qrand copied to clipboard

Cache persistence

Open pedrorrivero opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Cache is hold in memory and gets erased when the python job holding it finishes.

Describe the solution you'd like

It should be possible to choose between holding the cache in memory or storage.

Describe alternatives you've considered

It is currently possible for the user to save and load the cache manually. However, if two programs are running at the same time and one uses bits in the cache, this will not be reflected on the other one. Leading to possible security issues and statistical biases.

Additional context

Concurrent access to the local file holding the cache has to be handled. This suggests using a singleton pattern along with semaphores in order to make it thread-safe. Performance has to be taken into account, since accessing a local file is always slower than simply reading from memory. Also, this feature should be available for all major OS distributions (i.e. Windows, MacOS, and Linux/Unix).

pedrorrivero avatar Apr 05 '21 02:04 pedrorrivero