3 #include "map2/map_insdel_int.h"
4 #include <cds/os/topology.h>
7 CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_int );
10 void Map_InsDel_int::setUpParams( const CppUnitMini::TestCfg& cfg ) {
11 c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount );
12 c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount );
13 c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount );
14 c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
15 c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
17 c_nCuckooInitialSize = cfg.getULong("CuckooInitialSize", static_cast<unsigned long>(c_nCuckooInitialSize) );
18 c_nCuckooProbesetSize = cfg.getULong("CuckooProbesetSize", static_cast<unsigned long>(c_nCuckooProbesetSize) );
19 c_nCuckooProbesetThreshold = cfg.getULong("CuckooProbesetThreshold", static_cast<unsigned long>(c_nCuckooProbesetThreshold) );
21 c_nMultiLevelMap_HeadBits = cfg.getULong("MultiLevelMapHeadBits", static_cast<unsigned long>(c_nMultiLevelMap_HeadBits) );
22 c_nMultiLevelMap_ArrayBits = cfg.getULong("MultiLevelMapArrayBits", static_cast<unsigned long>(c_nMultiLevelMap_ArrayBits) );
24 c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
26 if ( c_nInsertThreadCount == 0 )
27 c_nInsertThreadCount = cds::OS::topology::processor_count();
28 if ( c_nDeleteThreadCount == 0 )
29 c_nDeleteThreadCount = cds::OS::topology::processor_count();
32 m_arrValues.reserve( c_nMapSize );
33 for ( size_t i = 0; i < c_nMapSize; ++i )
34 m_arrValues.push_back( i );
35 shuffle( m_arrValues.begin(), m_arrValues.end() );