Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Thread Safe LRU Cache #81

Open
Socrats opened this issue Oct 3, 2023 · 0 comments
Open

Implement a Thread Safe LRU Cache #81

Socrats opened this issue Oct 3, 2023 · 0 comments

Comments

@Socrats
Copy link
Owner

Socrats commented Oct 3, 2023

We need a thread safe LRU cache to improve the efficiency of the monte-carlo simulations used to estimate stationary distributions and other indicators.

At the moment, we use a cache to store the fitness values that are reused the most (fitness of a strategy given a population state). Since the LRUCache currently implemented is not thread safe, each thread of the simulation must instantiate its own LRU Cache. However, it would probably be much more efficient if the Cache was shared.

Ideally this would allow the use of a single, share LRU cache per simulation. This cache would be shared among each thread/process that is running an independent Monte-Carlo simulation to estimate a given indicator. I have already created an initial file where this new class could be written. See LRUCacheThreadSafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant