Comments (3)
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.
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.
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)
- Invalid random level in skip list with custom random level generator (the one than can return more than c_nMaxHeight)
- словил хайп
- Some questions about this library HOT 1
- Broken URL
- Is it possible to use std::atomic<> as cuckoo map value type?
- Assertion Error with FCdeque HOT 1
- Library usage HOT 2
- FeldmanHashMap find function NULL pointer HOT 3
- [Minor] readme.md evolution YouTube link broken HOT 1
- Impossible to build on visual studio (C2491 and C2720) HOT 2
- add readonly function to improve performance
- FreeBSD's ThreadId is pthread_t*
- BronsonAVLTreeMap segfaults HOT 2
- Cannot build properly on MacOS Big Sur 11.2.3 (Apple M1)
- Why KV list's update() method have no argument with Value to insert ?
- Tests fail to compile: member reference base type 'testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'int') is not a structure or union, etc. HOT 1
- Benchmarks are missing
- Add support for riscv64, mips64el
- Assert failure in smr::~smr() HOT 1
- Sized delete called with incorrect size
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 libcds.