c_nDelThreadCount = cds::OS::topology::processor_count() - c_nExtractThreadCount;
}
- m_arrData.resize( c_nMapSize );
- for ( size_t i = 0; i < c_nMapSize; ++i )
- m_arrData[i] = i;
- std::random_shuffle( m_arrData.begin(), m_arrData.end() );
+ m_arrInsert.resize( c_nMapSize );
+ m_arrRemove.resize( c_nMapSize );
+ for ( size_t i = 0; i < c_nMapSize; ++i ) {
+ m_arrInsert[i] = i;
+ m_arrRemove[i] = i;
+ }
+ std::random_shuffle( m_arrInsert.begin(), m_arrInsert.end() );
+ std::random_shuffle( m_arrRemove.begin(), m_arrRemove.end() );
}
void Map_DelOdd::myRun(const char *in_name, bool invert /*= false*/)
static size_t c_nMaxLoadFactor; // maximum load factor
static bool c_bPrintGCState;
- std::vector<size_t> m_arrData;
+ std::vector<size_t> m_arrInsert;
+ std::vector<size_t> m_arrRemove;
protected:
typedef CppUnitMini::TestCase Base;
m_nInsertSuccess =
m_nInsertFailed = 0;
- std::vector<size_t>& arrData = getTest().m_arrData;
+ std::vector<size_t>& arrData = getTest().m_arrInsert;
for ( size_t i = 0; i < arrData.size(); ++i ) {
if ( rMap.insert( key_type( arrData[i], m_nThreadNo )))
++m_nInsertSuccess;
m_nDeleteFailed = 0;
for ( size_t pass = 0; pass < 2; pass++ ) {
- std::vector<size_t>& arrData = getTest().m_arrData;
+ std::vector<size_t>& arrData = getTest().m_arrRemove;
if ( m_nThreadNo & 1 ) {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
typename Map::guarded_ptr gp;
for ( size_t pass = 0; pass < 2; ++pass ) {
- std::vector<size_t>& arrData = getTest().m_arrData;
+ std::vector<size_t>& arrData = getTest().m_arrRemove;
if ( m_nThreadNo & 1 ) {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
typename Map::exempt_ptr xp;
- std::vector<size_t>& arrData = getTest().m_arrData;
+ std::vector<size_t>& arrData = getTest().m_arrRemove;
if ( m_nThreadNo & 1 ) {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
additional_cleanup( testMap );
}
-
template <class Map>
void test()
{