event_counter m_nInsertSuccess; ///< Number of success \p insert() operations
event_counter m_nInsertFailed; ///< Number of failed \p insert() operations
event_counter m_nInsertRetry; ///< Number of attempts to insert new item
- event_counter m_nInsertReuse; ///< Number of reusing empty node when inserting
- event_counter m_nInsertReuseFailed; ///< Number of failed attempsof reusing free node when inserting
+ event_counter m_nReuseNode; ///< Number of reusing empty node when inserting/updating
+ event_counter m_nReuseNodeFailed; ///< Number of failed attempsof reusing free node when inserting/updating
event_counter m_nUpdateNew; ///< Number of new item inserted for \p update()
event_counter m_nUpdateExisting; ///< Number of existing item updates
event_counter m_nUpdateFailed; ///< Number of failed \p update() call
void onInsertSuccess() { ++m_nInsertSuccess; }
void onInsertFailed() { ++m_nInsertFailed; }
void onInsertRetry() { ++m_nInsertRetry; }
- void onInsertReuse() { ++m_nInsertReuse; }
- void onInsertReuseFailed() { ++m_nInsertReuseFailed; }
+ void onReuseNode() { ++m_nReuseNode; }
+ void onReuseNodeFailed() { ++m_nReuseNodeFailed; }
void onUpdateNew() { ++m_nUpdateNew; }
void onUpdateExisting() { ++m_nUpdateExisting; }
void onUpdateFailed() { ++m_nUpdateFailed; }
void onInsertSuccess() const {}
void onInsertFailed() const {}
void onInsertRetry() const {}
- void onInsertReuse() const {}
- void onInsertReuseFailed() const {}
+ void onReuseNode() const {}
+ void onReuseNodeFailed() const {}
void onUpdateNew() const {}
void onUpdateExisting() const {}
void onUpdateFailed() const {}
void onInsertSuccess() { m_stat.onInsertSuccess(); }
void onInsertFailed() { m_stat.onInsertFailed(); }
void onInsertRetry() { m_stat.onInsertRetry(); }
- void onInsertReuse() { m_stat.onInsertReuse(); }
- void onInsertReuseFailed() { m_stat.onInsertReuseFailed(); }
+ void onReuseNode() { m_stat.onReuseNode(); }
+ void onReuseNodeFailed() { m_stat.onReuseNodeFailed(); }
void onUpdateNew() { m_stat.onUpdateNew(); }
void onUpdateExisting() { m_stat.onUpdateExisting();}
void onUpdateFailed() { m_stat.onUpdateFailed(); }
return false;
}
- value_type * pVal = pos.guard.protect( pCur->data,
+ value_type * pVal = pos.guard.protect( pCur->data,
[]( marked_data_ptr p ) -> value_type*
{
- return p.ptr();
+ return p.ptr();
}).ptr();
if ( pVal ) {
marked_data_ptr val( pos.pFound );
if ( pos.pCur && !pos.pCur->data.compare_exchange_strong( val, val | 1, memory_model::memory_order_acquire, atomics::memory_order_relaxed )) {
// oops, pos.pCur data has been changed or another thread is setting pos.pPrev data
- m_Stat.onInsertReuseFailed();
+ m_Stat.onReuseNodeFailed();
return false;
}
pos.pCur->data.store( val, memory_model::memory_order_relaxed );
if ( result )
- m_Stat.onInsertReuse();
+ m_Stat.onReuseNode();
return result;
}
else {
<< CDSSTRESS_STAT_OUT( s, m_nInsertSuccess )
<< CDSSTRESS_STAT_OUT( s, m_nInsertFailed )
<< CDSSTRESS_STAT_OUT( s, m_nInsertRetry )
- << CDSSTRESS_STAT_OUT( s, m_nInsertReuse )
- << CDSSTRESS_STAT_OUT( s, m_nInsertReuseFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nReuseNode )
+ << CDSSTRESS_STAT_OUT( s, m_nReuseNodeFailed )
<< CDSSTRESS_STAT_OUT( s, m_nUpdateNew )
<< CDSSTRESS_STAT_OUT( s, m_nUpdateExisting )
<< CDSSTRESS_STAT_OUT( s, m_nUpdateFailed )