LibCds: Michael Hashmap and Split Order List

后端 未结 1 1365
花落未央
花落未央 2021-02-09 17:58

I am using libcds and they have an implementation of Michael Hash Map and Split order list.

Based on the information I gathered from the doc here is how I implemented th

相关标签:
1条回答
  • 2021-02-09 18:36

    According to the docs, it looks like you are missing the initialization of CDS and the threading manager:

    #include <cds/threading/model.h>    // threading manager
    #include <cds/gc/hzp/hzp.h>         // Hazard Pointer GC
    
    // ...
    
    int main()
    {
        // Initialize CDS library
        cds::Initialize() ;
    
        // Initialize Garbage collector(s) that you use 
        cds::gc::hzp::GarbageCollector::Construct() ;
    
        // attach this thread to CDS:
        cds::threading::Manager::attachThread() ;
    
        // Do some useful work 
    
        Configuration _gConfiguration;
        TestDs* _gTestDs1 = new Michael(_gConfiguration);
        TestDs* _gTestDs2 = new CDSSplit(_gConfiguration);
    
        // Terminate GCs 
        cds::gc::hzp::GarbageCollector::Destruct() ;
    
        // Terminate CDS library
        cds::Terminate()    ;
    
        return 0;
    }
    
    0 讨论(0)
提交回复
热议问题