Giter VIP home page Giter VIP logo

Comments (5)

Lol3rrr avatar Lol3rrr commented on June 26, 2024 1

Hi, sorry for the "delay" since the last activity on this. I now got the chance to take a look at the sento crate and I dont think that would currently fit into the approach here, as you cant get a "snapshot" of the currently acquired elements.

If I am not missing anything here, I will probably look into continue rolling a custom linked list here that supports the snapshots we would need or we could adapt the sento crate, but I am not sure that would be the right way about this.

from left-right.

Lol3rrr avatar Lol3rrr commented on June 26, 2024

After looking at the Code more closely, I also found that it uses the std::Mutex for epochs and I dont really know how we can adjust that without adding a new dependency like spin which I would like to avoid for now. Any ideas would be welcome

from left-right.

jonhoo avatar jonhoo commented on June 26, 2024

It'd definitely be nice if left-right could work in a no_std environment! For yielding, I think the function pointer approach is a good one. For the Mutex, I wonder if the way to go about it is the disallow creating a dynamic number of read/write handles, and instead have a constructor that takes a const generic <const R: usize> of the number of read handles to create, and then back it by an R-length array. The Mutex is only there to allow new handles to be added on the fly. Now, having both the dynamic and non-dynamic versions co-exist may end up being a little tricky, but I think it's probably doable.

from left-right.

Lol3rrr avatar Lol3rrr commented on June 26, 2024

Although the Array approach could definetly work I dont know if it may be too restrictive because you may not know how many readers there will be.
One quick thought I had was maybe using a "simple" lock free linked list, which could only grow or entries could be set to "free/vacant" to allow new read handles to pick them up again. This way we could have an unlimited number of Handles will still avoiding the Lock, however Im not sure if this would work with the writer as it can take like a "snapshot" and see all the read handles, but that may be fine because if a new one gets added while looking through the entries it should already see the new Pointer as well and therefore be save, but this definitely needs some more thought put into it.

Otherwise I could probably already start with some of the other changes and see how that looks in the meantime

from left-right.

jonhoo avatar jonhoo commented on June 26, 2024

Hmm, I think that could work, since the tail of the list still represents a snapshot. I'm imagining a lock free linked list where new ones are always added at the head — then to take a snapshot the writer simply reads the current head and iterates on the list from there and onwards. We may need to do some due diligence to make sure we get the right semantics, but on the surface it looks like a reasonable approach!

from left-right.

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.