CUBRID Engine
latest
|
#include <lock_free.h>
Classes | |
class | iterator |
Public Member Functions | |
lf_hash_table_cpp () | |
void | init (lf_tran_system &transys, int hash_size, int freelist_block_count, int freelist_block_size, lf_entry_descriptor &edes) |
void | destroy () |
T * | find (lf_tran_entry *t_entry, Key &key) |
bool | find_or_insert (lf_tran_entry *t_entry, Key &key, T *&t) |
bool | insert (lf_tran_entry *t_entry, Key &key, T *&t) |
bool | insert_given (lf_tran_entry *t_entry, Key &key, T *&t) |
bool | erase (lf_tran_entry *t_entry, Key &key) |
bool | erase_locked (lf_tran_entry *t_entry, Key &key, T *&t) |
void | unlock (lf_tran_entry *t_entry, T *&t) |
void | clear (lf_tran_entry *t_entry) |
T * | freelist_claim (lf_tran_entry *t_entry) |
void | freelist_retire (lf_tran_entry *t_entry, T *&t) |
void | start_tran (lf_tran_entry *t_entry) |
void | end_tran (lf_tran_entry *t_entry) |
size_t | get_size () const |
size_t | get_element_count () const |
lf_hash_table & | get_hash_table () |
lf_freelist & | get_freelist () |
Private Member Functions | |
pthread_mutex_t * | get_pthread_mutex (T *t) |
template<typename F > | |
bool | generic_insert (F &ins_func, lf_tran_entry *t_entry, Key &key, T *&t) |
Private Attributes | |
lf_freelist | m_freelist |
lf_hash_table | m_hash |
Definition at line 363 of file lock_free.h.
lf_hash_table_cpp< Key, T >::lf_hash_table_cpp | ( | ) |
Definition at line 430 of file lock_free.h.
References assert, lf_hash_table_cpp< Key, T >::init(), lf_freelist_init(), lf_hash_init(), lf_hash_table_cpp< Key, T >::m_freelist, lf_hash_table_cpp< Key, T >::m_hash, and NO_ERROR.
void lf_hash_table_cpp< Key, T >::clear | ( | lf_tran_entry * | t_entry | ) |
Definition at line 562 of file lock_free.h.
References lf_hash_clear(), and lf_hash_table_cpp< Key, T >::m_hash.
Referenced by test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), and test_hash_iterator().
void lf_hash_table_cpp< Key, T >::destroy | ( | ) |
Definition at line 455 of file lock_free.h.
References lf_freelist_destroy(), lf_hash_destroy(), lf_hash_table_cpp< Key, T >::m_freelist, and lf_hash_table_cpp< Key, T >::m_hash.
Referenced by test_hash_iterator(), and test_hash_table().
void lf_hash_table_cpp< Key, T >::end_tran | ( | lf_tran_entry * | t_entry | ) |
Definition at line 591 of file lock_free.h.
References lf_tran_end_with_mb.
bool lf_hash_table_cpp< Key, T >::erase | ( | lf_tran_entry * | t_entry, |
Key & | key | ||
) |
Definition at line 517 of file lock_free.h.
References assert, lf_hash_delete(), lf_hash_table_cpp< Key, T >::m_hash, NO_ERROR, and success().
Referenced by test_clear_proc_1(), test_clear_proc_2(), test_hash_proc_1(), and test_hash_proc_2().
bool lf_hash_table_cpp< Key, T >::erase_locked | ( | lf_tran_entry * | t_entry, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 529 of file lock_free.h.
References assert, lf_hash_table_cpp< Key, T >::get_pthread_mutex(), lf_hash_delete_already_locked(), lf_hash_table_cpp< Key, T >::m_hash, NO_ERROR, NULL, pthread_mutex_unlock, and success().
Referenced by test_clear_proc_3(), and test_hash_proc_3().
T * lf_hash_table_cpp< Key, T >::find | ( | lf_tran_entry * | t_entry, |
Key & | key | ||
) |
Definition at line 471 of file lock_free.h.
References assert, lf_hash_find(), lf_hash_table_cpp< Key, T >::m_hash, NO_ERROR, and NULL.
bool lf_hash_table_cpp< Key, T >::find_or_insert | ( | lf_tran_entry * | t_entry, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 496 of file lock_free.h.
References lf_hash_table_cpp< Key, T >::generic_insert(), and lf_hash_find_or_insert().
Referenced by test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), test_hash_iterator(), test_hash_proc_1(), test_hash_proc_2(), and test_hash_proc_3().
T * lf_hash_table_cpp< Key, T >::freelist_claim | ( | lf_tran_entry * | t_entry | ) |
Definition at line 569 of file lock_free.h.
References lf_freelist_claim(), and lf_hash_table_cpp< Key, T >::m_freelist.
void lf_hash_table_cpp< Key, T >::freelist_retire | ( | lf_tran_entry * | t_entry, |
T *& | t | ||
) |
Definition at line 576 of file lock_free.h.
References lf_freelist_retire(), lf_hash_table_cpp< Key, T >::m_freelist, and NULL.
|
private |
Definition at line 484 of file lock_free.h.
References assert, lf_hash_table_cpp< Key, T >::m_hash, and NO_ERROR.
Referenced by lf_hash_table_cpp< Key, T >::find_or_insert(), lf_hash_table_cpp< Key, T >::insert(), and lf_hash_table_cpp< Key, T >::insert_given().
size_t lf_hash_table_cpp< Key, T >::get_element_count | ( | ) | const |
Definition at line 606 of file lock_free.h.
References lf_freelist::alloc_cnt, lf_freelist::available_cnt, lf_hash_table_cpp< Key, T >::m_freelist, and lf_freelist::retired_cnt.
lf_freelist & lf_hash_table_cpp< Key, T >::get_freelist | ( | ) |
Definition at line 629 of file lock_free.h.
References lf_hash_table_cpp< Key, T >::m_freelist.
Referenced by test_hash_iterator(), and test_hash_table().
lf_hash_table & lf_hash_table_cpp< Key, T >::get_hash_table | ( | ) |
Definition at line 622 of file lock_free.h.
References lf_hash_table_cpp< Key, T >::m_hash.
Referenced by test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), test_hash_iterator(), test_hash_proc_1(), test_hash_proc_2(), test_hash_proc_3(), and test_hash_table().
|
private |
Definition at line 463 of file lock_free.h.
References assert, lf_freelist::entry_desc, lf_hash_table_cpp< Key, T >::m_freelist, lf_entry_descriptor::of_mutex, and lf_entry_descriptor::using_mutex.
Referenced by lf_hash_table_cpp< Key, T >::erase_locked(), and lf_hash_table_cpp< Key, T >::unlock().
size_t lf_hash_table_cpp< Key, T >::get_size | ( | void | ) | const |
Definition at line 598 of file lock_free.h.
References assert, lf_hash_table::hash_size, and lf_hash_table_cpp< Key, T >::m_hash.
void lf_hash_table_cpp< Key, T >::init | ( | lf_tran_system & | transys, |
int | hash_size, | ||
int | freelist_block_count, | ||
int | freelist_block_size, | ||
lf_entry_descriptor & | edes | ||
) |
Referenced by lf_hash_table_cpp< Key, T >::lf_hash_table_cpp(), test_hash_iterator(), and test_hash_table().
bool lf_hash_table_cpp< Key, T >::insert | ( | lf_tran_entry * | t_entry, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 503 of file lock_free.h.
References lf_hash_table_cpp< Key, T >::generic_insert(), and lf_hash_insert().
bool lf_hash_table_cpp< Key, T >::insert_given | ( | lf_tran_entry * | t_entry, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 510 of file lock_free.h.
References lf_hash_table_cpp< Key, T >::generic_insert(), and lf_hash_insert_given().
void lf_hash_table_cpp< Key, T >::start_tran | ( | lf_tran_entry * | t_entry | ) |
Definition at line 584 of file lock_free.h.
References lf_tran_start_with_mb.
void lf_hash_table_cpp< Key, T >::unlock | ( | lf_tran_entry * | t_entry, |
T *& | t | ||
) |
Definition at line 546 of file lock_free.h.
References assert, lf_freelist::entry_desc, lf_hash_table_cpp< Key, T >::get_pthread_mutex(), lf_tran_end_with_mb, lf_hash_table_cpp< Key, T >::m_freelist, NULL, pthread_mutex_unlock, and lf_entry_descriptor::using_mutex.
Referenced by test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), test_hash_iterator(), test_hash_proc_1(), test_hash_proc_2(), and test_hash_proc_3().
|
private |
Definition at line 402 of file lock_free.h.
Referenced by lf_hash_table_cpp< Key, T >::destroy(), lf_hash_table_cpp< Key, T >::freelist_claim(), lf_hash_table_cpp< Key, T >::freelist_retire(), lf_hash_table_cpp< Key, T >::get_element_count(), lf_hash_table_cpp< Key, T >::get_freelist(), lf_hash_table_cpp< Key, T >::get_pthread_mutex(), lf_hash_table_cpp< Key, T >::lf_hash_table_cpp(), and lf_hash_table_cpp< Key, T >::unlock().
|
private |
Definition at line 403 of file lock_free.h.
Referenced by lf_hash_table_cpp< Key, T >::clear(), lf_hash_table_cpp< Key, T >::destroy(), lf_hash_table_cpp< Key, T >::erase(), lf_hash_table_cpp< Key, T >::erase_locked(), lf_hash_table_cpp< Key, T >::find(), lf_hash_table_cpp< Key, T >::generic_insert(), lf_hash_table_cpp< Key, T >::get_hash_table(), lf_hash_table_cpp< Key, T >::get_size(), lf_hash_table_cpp< Key, T >::iterator::iterator(), and lf_hash_table_cpp< Key, T >::lf_hash_table_cpp().