I ported the lock free skiplist from the art of multiprocessor programming to C++
Re: I ported the lock free skiplist from the art of multiprocessor programming to C++
this does assume you either finish implementing the epoch manager (i ripped this out of my task scheduler and just wanted the list to run separately for a demo -- you can see the full code in the other project in the repo which is a hobby project im working on)
or have another memory management model in place in the demo it WILL leak memory because epochmanager is just a dummy class not the real one -- in the real system you tick() the epochmanager after threads finish their tasks or another reasonable time in the program -- i used a clock -- you could base it on list operations too on a counter but time is a decent approx of garbage collection as long as you KNOW it will be deleted in a few cycles
this then IF the time is beyond your set safe threshold time deletes the memory like crude timer based garbage collection but this is just an example of the list since i couldnt find one when i was trying to do it
Re: I ported the lock free skiplist from the art of multiprocessor programming to C++
The C++ lock-free skiplist you ported requires a memory management system to avoid leaks. In your demo, the `EpochManager` is just a placeholder, so memory isn?t reclaimed. In a full system, you would tick the epoch manager after threads finish or use a timer/counter to safely delete nodes, effectively acting as simple garbage collection. Without this, the demo will leak memory.