Giter Site home page Giter Site logo

ABA in Michael's linked list? about libcds HOT 3 CLOSED

khizmax avatar khizmax commented on May 18, 2024
ABA in Michael's linked list?

from libcds.

Comments (3)

khizmax avatar khizmax commented on May 18, 2024

Hi,
You created ABA-problem for yourself :-) Lock-free intrusive containers are tricky.
HP is a schema for deferred reclamation. After erase() call the item is put into internal HP retired buffer. When this buffer becomes full, a disposer you provided in Traits will be invoked. And only after disposer has been called you may reuse the item. Otherwise, if you insert() the item immediately after erase() it as you write your item will be in HP retired buffer as "death" and in the list as "alive".
For details, see retire_node and clean_disposer

from libcds.

kiith-sa avatar kiith-sa commented on May 18, 2024

Thanks,

So basically, I need to define a disposer to free an element (e.g. recycling it to a free list) -
and then only reuse those elements I recycled? Is there an example/spec for the disposer ? (only did a quick search as I'm leaving for train right now, didn't find it).

I'm closing the issue as there is no bug.

from libcds.

khizmax avatar khizmax commented on May 18, 2024

Yes, you should define a disposer. When your disposer will be invoked you may do anything with the item - you may delete it, or you may reuse it and so on.
The disposer call is just a signal from within HP: "that pointer is free, you can reuse it".

from libcds.

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.