-
Notifications
You must be signed in to change notification settings - Fork 275
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
Purging (erasing) random records #80
Comments
I've ended up implementing:
inside cuckoohash_map.hh. As it resolves a very specific type of issue, I would not commit anything. |
Would you accept this function into master branch? |
Is this plan still feasible today, as there is no 'snapshot_and_lock_one' now, only 'snapshot_and_lock_two' |
Hi there. We do not plan on supporting a "pick random key" sort-of functionality as part of the table. For cache-eviction like problems, I have often seen people track additional metadata outside of the main data structure. For example, very primitively:
While this approach does incur the overhead of maintaining |
What's the most efficient way of purging some random values from libcuckoo?
E.g. we have implemented a map where each value has a TTL field assigned. From time to time (e.g. after every N-th insert) we need to randomly pick and purge some expired records. Here are the two ways I can think so far:
Any thoughts?
The second question is: can we safely call functions like insert\update\erase from within update_fn\erase_fn\insert_fn lambdas code?
Thanks!
The text was updated successfully, but these errors were encountered: