23 #ifndef _THREAD_LOCKFREE_HASH_MAP_HPP_ 24 #define _THREAD_LOCKFREE_HASH_MAP_HPP_ 34 template <
class Key,
class T>
42 void init (
lf_tran_system &transys,
int entry_idx,
int hash_size,
int freelist_block_size,
88 template <
class Key,
class T>
118 template <
class Key,
class T>
126 template <
class Key,
class T>
134 (
size_t) freelist_block_count, edesc);
138 init_as_old (transys, hash_size, freelist_block_count, freelist_block_size, edesc, entry_idx);
142 template <
class Key,
class T>
148 m_old_hash.init (transys, hash_size, freelist_block_count, freelist_block_size, edesc);
152 template <
class Key,
class T>
158 m_new_hash.init (transys, hash_size, freelist_block_size, freelist_block_count, edesc);
161 #define lockfree_hashmap_forward_func(f_, tp_, ...) \ 163 m_old_hash.f_ (get_tran_entry (tp_), __VA_ARGS__) : \ 164 m_new_hash.f_ ((tp_)->get_lf_tran_index (), __VA_ARGS__) 165 #define lockfree_hashmap_forward_func_noarg(f_, tp_) \ 167 m_old_hash.f_ (get_tran_entry (tp_)) : \ 168 m_new_hash.f_ ((tp_)->get_lf_tran_index ()) 170 template <
class Key,
class T>
189 template <
class Key,
class T>
196 template <
class Key,
class T>
203 template <
class Key,
class T>
210 template <
class Key,
class T>
217 template <
class Key,
class T>
224 template <
class Key,
class T>
231 template <
class Key,
class T>
238 template <
class Key,
class T>
245 template <
class Key,
class T>
252 template <
class Key,
class T>
259 template <
class Key,
class T>
266 template <
class Key,
class T>
273 template <
class Key,
class T>
280 template <
class Key,
class T>
287 #undef lockfree_hashmap_forward_func 288 #undef lockfree_hashmap_forward_func_noarg 290 template <
class Key,
class T>
298 template <
class Key,
class T>
308 template <
class Key,
class T>
324 template <
class Key,
class T>
338 template <
class Key,
class T>
353 #endif // !_THREAD_LOCKFREE_HASH_MAP_HPP_
size_t get_element_count() const
lockfree::tran::system & get_thread_entry_lftransys()
lf_tran_entry * tran_entries[THREAD_TS_COUNT]
void unlock(cubthread::entry *thread_p, T *&t)
lf_tran_entry * get_tran_entry(cubthread::entry *thread_p)
void init_as_new(lockfree::tran::system &transys, size_t hash_size, size_t freelist_block_size, size_t freelist_block_count, lf_entry_descriptor &edesc)
lf_hash_table_cpp< Key, T >::iterator m_old_iter
T * freelist_claim(cubthread::entry *thread_p)
bool erase(cubthread::entry *thread_p, Key &key)
#define lockfree_hashmap_forward_func(f_, tp_,...)
bool find_or_insert(cubthread::entry *thread_p, Key &key, T *&t)
void end_tran(cubthread::entry *thread_p)
T * find(cubthread::entry *thread_p, Key &key)
void freelist_retire(cubthread::entry *thread_p, T *&t)
bool erase_locked(cubthread::entry *thread_p, Key &key, T *&t)
bool insert(cubthread::entry *thread_p, Key &key, T *&t)
lockfree::tran::index get_lf_tran_index()
bool insert_given(cubthread::entry *thread_p, Key &key, T *&t)
void init(lf_tran_system &transys, int entry_idx, int hash_size, int freelist_block_size, int freelist_block_count, lf_entry_descriptor &edesc)
lf_hash_table_cpp< Key, T > m_old_hash
lockfree::hashmap< Key, T > m_new_hash
#define lockfree_hashmap_forward_func_noarg(f_, tp_)
iterator(cubthread::entry *thread_p, lockfree_hashmap &map)
lockfree::hashmap< Key, T >::iterator m_new_iter
bool prm_get_bool_value(PARAM_ID prm_id)
void clear(cubthread::entry *thread_p)
void init_as_old(lf_tran_system &transys, int hash_size, int freelist_block_count, int freelist_block_size, lf_entry_descriptor &edesc, int entry_idx)
void start_tran(cubthread::entry *thread_p)