LibCds: Michael Hashmap and Split Order List

醉酒当歌 提交于 2019-12-03 08:30:07
sehe

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;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!