Comments (3)
Hi, great! thanks! one more thing in cache.hpp: if the locks are working then there is also a double lock when checking the Size(). I made these changes while sticking to the non-recursive std::mutex mutex type.
if (elem_it == cache_items_map.end())
{
// add new element to the cache
- if (Size() + 1 > max_cache_size)
+ if (cache_items_map.size() + 1 > max_cache_size)
{
auto disp_candidate_key = cache_policy.ReplCandidate();
from caches.
Hello @thorroed,
Thank you for your report. I'll fix that issue.
from caches.
Should be fixed in PR #11. Thank you @thorroed once again! 😄
from caches.
Related Issues (15)
- Update Get method to return std::optional HOT 2
- using as cmake HOT 1
- small edit in the readme example HOT 1
- Uncomplicated multithreaded design? HOT 2
- FIFO cache policy Key Removal mismatches actual removed key HOT 2
- multithreading issue HOT 3
- Pass map as template param to replace unorder_map HOT 4
- cache_policy.hpp raises warning when compiled with -Wunused-parameter HOT 1
- It works for iOS and Android? HOT 2
- 是否支持时间过期? HOT 2
- 你好,请问是线程安全的吗
- `std::unordered_set` does not have a function named `crbegin` HOT 2
- overload the Get function when the key is not in the cache HOT 2
- change the permission for Erase() to public HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caches.