template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
class ib_counter_t< Type, N, Indexer >
Class for using fuzzy counters. The counter is not protected by any
mutex and the results are not guaranteed to be 100% accurate but close enough. Creates an array of counters and separates each element by the CACHE_LINE_SIZE bytes
Definition at line 111 of file ut0counter.h.
template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::add |
( |
size_t |
index, |
|
|
Type |
n |
|
) |
| |
|
inline |
Use this if you can use a unique indentifier, saves a
call to get_rnd_index().
- Parameters
-
i | - index into a slot |
n | - amount to increment |
Definition at line 151 of file ut0counter.h.
template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::sub |
( |
size_t |
index, |
|
|
Type |
n |
|
) |
| |
|
inline |
Use this if you can use a unique indentifier, saves a
call to get_rnd_index().
- Parameters
-
i | - index into a slot |
n | - amount to decrement |
Definition at line 176 of file ut0counter.h.