Coder Social home page Coder Social logo

Use generic key-val store about lru-rs HOT 2 OPEN

jeromefroe avatar jeromefroe commented on September 26, 2024
Use generic key-val store

from lru-rs.

Comments (2)

jeromefroe avatar jeromefroe commented on September 26, 2024

Hi @gauteh! I like this idea, but I think it may be tricky to implement because the cache uses both a hashmap and a linked list internally. So while it may be fairly straightforward to swap out the current hashmap with dashmap, converting the linked list to support concurrent operations will likely be more difficult because it's implemented by hand. And then, even if both the hashmap and linked list supported concurrent operations, we would still have to ensure that their composition also supported concurrent operations correctly as well. With that being said, I'm certainly not opposed to the idea, it's just that I think it would take a good chunk of work and I'm not sure I'd be able to devote the necessary amount of time to it. I'd love to be proven wrong though if you have different thoughts on how to approach this?

from lru-rs.

matklad avatar matklad commented on September 26, 2024

For the reference, at near we are using Arc<Mutex> as well, wrapped into this data structure:

https://github.com/near/nearcore/blob/master/utils/near-cache/src/sync.rs

from lru-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.