CUBRID Engine
latest
|
#include "dbtype_def.h"
#include "lockfree_bitmap.hpp"
#include "porting.h"
#include <cassert>
#include <pthread.h>
Go to the source code of this file.
Classes | |
struct | lf_entry_descriptor |
struct | lf_tran_entry |
struct | lf_tran_system |
struct | lf_freelist |
struct | lf_hash_table |
struct | lf_hash_table_iterator |
class | lf_hash_table_cpp< Key, T > |
class | lf_hash_table_cpp< Key, T >::iterator |
Macros | |
#define | VOLATILE_ACCESS(v, t) (*((t volatile *) &(v))) |
#define | LF_EM_NOT_USING_MUTEX 0 |
#define | LF_EM_USING_MUTEX 1 |
#define | LF_ENTRY_DESCRIPTOR_INITIALIZER |
#define | LF_NULL_TRANSACTION_ID ULONG_MAX |
#define | LF_TRAN_ENTRY_INITIALIZER { 0, LF_NULL_TRANSACTION_ID, NULL, NULL, NULL, -1, false } |
#define | LF_TRAN_SYSTEM_INITIALIZER { NULL, 0, {}, 0, 0, 100, 0, NULL } |
#define | LF_TRAN_CLEANUP_NECESSARY(e) ((e)->tran_system->min_active_transaction_id > (e)->last_cleanup_id) |
#define | lf_tran_start_with_mb(entry, incr) lf_tran_start (entry, incr); MEMORY_BARRIER () |
#define | lf_tran_end_with_mb(entry) MEMORY_BARRIER (); lf_tran_end (entry) |
#define | LF_FREELIST_INITIALIZER { NULL, 0, 0, 0, 0, NULL, NULL } |
#define | LF_LIST_BF_NONE 0x0 |
#define | LF_LIST_BF_RETURN_ON_RESTART ((int) 0x01) |
#define | LF_LIST_BF_RESTART_ON_DUPLICATE ((int) 0x02) /* Not used for now. */ |
#define | LF_LIST_BF_INSERT_GIVEN ((int) 0x04) |
#define | LF_LIST_BF_FIND_OR_INSERT ((int) 0x08) |
#define | LF_LIST_BF_LOCK_ON_DELETE ((int) 0x10) |
#define | LF_LIST_BF_IS_FLAG_SET(bf, flag) ((*(bf) & (flag)) != 0) |
#define | LF_LIST_BF_SET_FLAG(bf, flag) (*(bf) = *(bf) | (flag)) |
#define | LF_LIST_BR_RESTARTED ((int) 0x100) |
#define | LF_LIST_BR_DUPLICATE ((int) 0x200) /* Not used for now. */ |
#define | LF_LIST_BR_IS_FLAG_SET(br, flag) ((*(br) & (flag))) |
#define | LF_LIST_BR_SET_FLAG(br, flag) (*(br) = *(br) | (flag)) |
#define | LF_HASH_TABLE_INITIALIZER { NULL, NULL, PTHREAD_MUTEX_INITIALIZER, 0, NULL, NULL } |
Typedefs | |
typedef void *(* | LF_ENTRY_ALLOC_FUNC) () |
typedef int(* | LF_ENTRY_FREE_FUNC) (void *) |
typedef int(* | LF_ENTRY_INITIALIZE_FUNC) (void *) |
typedef int(* | LF_ENTRY_UNINITIALIZE_FUNC) (void *) |
typedef int(* | LF_ENTRY_KEY_COPY_FUNC) (void *src, void *dest) |
typedef int(* | LF_ENTRY_KEY_COMPARE_FUNC) (void *key1, void *key2) |
typedef unsigned int(* | LF_ENTRY_HASH_FUNC) (void *key, int htsize) |
typedef int(* | LF_ENTRY_DUPLICATE_KEY_HANDLER) (void *key, void *existing) |
typedef struct lf_entry_descriptor | LF_ENTRY_DESCRIPTOR |
typedef struct lf_tran_system | LF_TRAN_SYSTEM |
typedef struct lf_tran_entry | LF_TRAN_ENTRY |
typedef struct lf_freelist | LF_FREELIST |
typedef struct lf_hash_table | LF_HASH_TABLE |
typedef struct lf_hash_table_iterator | LF_HASH_TABLE_ITERATOR |
#define LF_EM_NOT_USING_MUTEX 0 |
Definition at line 59 of file lock_free.h.
Referenced by heap_initialize_hfid_table().
#define LF_EM_USING_MUTEX 1 |
Definition at line 60 of file lock_free.h.
Referenced by logtb_initialize_global_unique_stats_table(), and main().
#define LF_ENTRY_DESCRIPTOR_INITIALIZER |
Definition at line 248 of file lock_free.h.
Definition at line 317 of file lock_free.h.
#define LF_LIST_BF_FIND_OR_INSERT ((int) 0x08) |
Definition at line 275 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::find_or_insert(), lockfree::hashmap< Key, T >::insert_given(), lf_hash_find_or_insert(), lf_hash_insert_given(), lf_list_insert_internal(), and lockfree::hashmap< Key, T >::list_insert_internal().
#define LF_LIST_BF_INSERT_GIVEN ((int) 0x04) |
Definition at line 274 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::hash_insert_internal(), lockfree::hashmap< Key, T >::insert_given(), lf_hash_insert_given(), lf_hash_insert_internal(), lf_list_insert_internal(), and lockfree::hashmap< Key, T >::list_insert_internal().
Definition at line 277 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::hash_insert_internal(), lf_hash_insert_internal(), lf_list_delete(), lf_list_insert_internal(), lockfree::hashmap< Key, T >::list_delete(), and lockfree::hashmap< Key, T >::list_insert_internal().
#define LF_LIST_BF_LOCK_ON_DELETE ((int) 0x10) |
Definition at line 276 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::erase(), lf_hash_delete(), lf_list_delete(), and lockfree::hashmap< Key, T >::list_delete().
#define LF_LIST_BF_NONE 0x0 |
Definition at line 269 of file lock_free.h.
#define LF_LIST_BF_RESTART_ON_DUPLICATE ((int) 0x02) /* Not used for now. */ |
Definition at line 273 of file lock_free.h.
Referenced by lf_list_insert_internal(), and lockfree::hashmap< Key, T >::list_insert_internal().
#define LF_LIST_BF_RETURN_ON_RESTART ((int) 0x01) |
Definition at line 272 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::erase(), lockfree::hashmap< Key, T >::erase_locked(), lockfree::hashmap< Key, T >::find(), lockfree::hashmap< Key, T >::find_or_insert(), lockfree::hashmap< Key, T >::insert(), lockfree::hashmap< Key, T >::insert_given(), lf_hash_delete(), lf_hash_delete_already_locked(), lf_hash_find(), lf_hash_find_or_insert(), lf_hash_insert(), lf_hash_insert_given(), lf_list_delete(), lf_list_find(), lf_list_insert_internal(), lockfree::hashmap< Key, T >::list_delete(), lockfree::hashmap< Key, T >::list_find(), and lockfree::hashmap< Key, T >::list_insert_internal().
Definition at line 278 of file lock_free.h.
#define LF_LIST_BR_DUPLICATE ((int) 0x200) /* Not used for now. */ |
Definition at line 282 of file lock_free.h.
Definition at line 283 of file lock_free.h.
#define LF_LIST_BR_RESTARTED ((int) 0x100) |
Definition at line 281 of file lock_free.h.
Referenced by lockfree::hashmap< Key, T >::find(), lockfree::hashmap< Key, T >::hash_erase_internal(), lockfree::hashmap< Key, T >::hash_insert_internal(), lf_hash_delete_internal(), lf_hash_find(), lf_hash_insert_internal(), lf_list_delete(), lf_list_find(), lf_list_insert_internal(), lockfree::hashmap< Key, T >::list_delete(), lockfree::hashmap< Key, T >::list_find(), and lockfree::hashmap< Key, T >::list_insert_internal().
Definition at line 284 of file lock_free.h.
Referenced by lf_list_insert_internal(), and lockfree::hashmap< Key, T >::list_insert_internal().
#define LF_NULL_TRANSACTION_ID ULONG_MAX |
Definition at line 115 of file lock_free.h.
Referenced by lf_freelist_claim(), lf_freelist_retire(), lf_tran_compute_minimum_transaction_id(), lf_tran_end(), lf_tran_request_entry(), lf_tran_return_entry(), lf_tran_start(), lf_tran_system_init(), and lf_hash_table_cpp< Key, T >::iterator::restart().
#define LF_TRAN_CLEANUP_NECESSARY | ( | e | ) | ((e)->tran_system->min_active_transaction_id > (e)->last_cleanup_id) |
Definition at line 182 of file lock_free.h.
Referenced by lf_freelist_claim(), and lf_freelist_retire().
#define lf_tran_end_with_mb | ( | entry | ) | MEMORY_BARRIER (); lf_tran_end (entry) |
Definition at line 198 of file lock_free.h.
Referenced by lf_hash_table_cpp< Key, T >::end_tran(), heap_cache_class_info(), heap_hfid_cache_get(), lf_freelist_claim(), lf_freelist_retire(), lf_hash_clear(), lf_hash_iterate(), lf_list_find(), logtb_reflect_global_unique_stats_to_btree(), lf_hash_table_cpp< Key, T >::iterator::restart(), test_freelist_proc(), and lf_hash_table_cpp< Key, T >::unlock().
#define LF_TRAN_ENTRY_INITIALIZER { 0, LF_NULL_TRANSACTION_ID, NULL, NULL, NULL, -1, false } |
Definition at line 150 of file lock_free.h.
#define lf_tran_start_with_mb | ( | entry, | |
incr | |||
) | lf_tran_start (entry, incr); MEMORY_BARRIER () |
Definition at line 197 of file lock_free.h.
Referenced by lf_freelist_claim(), lf_freelist_retire(), lf_hash_clear(), lf_hash_iterate(), lf_list_find(), lf_hash_table_cpp< Key, T >::start_tran(), and test_freelist_proc().
Definition at line 179 of file lock_free.h.
#define VOLATILE_ACCESS | ( | v, | |
t | |||
) | (*((t volatile *) &(v))) |
Definition at line 45 of file lock_free.h.
typedef void*(* LF_ENTRY_ALLOC_FUNC) () |
Definition at line 50 of file lock_free.h.
typedef struct lf_entry_descriptor LF_ENTRY_DESCRIPTOR |
Definition at line 62 of file lock_free.h.
typedef int(* LF_ENTRY_DUPLICATE_KEY_HANDLER) (void *key, void *existing) |
Definition at line 57 of file lock_free.h.
typedef int(* LF_ENTRY_FREE_FUNC) (void *) |
Definition at line 51 of file lock_free.h.
typedef unsigned int(* LF_ENTRY_HASH_FUNC) (void *key, int htsize) |
Definition at line 56 of file lock_free.h.
typedef int(* LF_ENTRY_INITIALIZE_FUNC) (void *) |
Definition at line 52 of file lock_free.h.
typedef int(* LF_ENTRY_KEY_COMPARE_FUNC) (void *key1, void *key2) |
Definition at line 55 of file lock_free.h.
typedef int(* LF_ENTRY_KEY_COPY_FUNC) (void *src, void *dest) |
Definition at line 54 of file lock_free.h.
typedef int(* LF_ENTRY_UNINITIALIZE_FUNC) (void *) |
Definition at line 53 of file lock_free.h.
typedef struct lf_freelist LF_FREELIST |
Definition at line 227 of file lock_free.h.
typedef struct lf_hash_table LF_HASH_TABLE |
Definition at line 295 of file lock_free.h.
typedef struct lf_hash_table_iterator LF_HASH_TABLE_ITERATOR |
Definition at line 336 of file lock_free.h.
typedef struct lf_tran_entry LF_TRAN_ENTRY |
Definition at line 118 of file lock_free.h.
typedef struct lf_tran_system LF_TRAN_SYSTEM |
Definition at line 117 of file lock_free.h.
int lf_callback_vpid_compare | ( | void * | vpid_1, |
void * | vpid_2 | ||
) |
Definition at line 154 of file lock_free.c.
References vpid::pageid, and vpid::volid.
int lf_callback_vpid_copy | ( | void * | src, |
void * | dest | ||
) |
Definition at line 169 of file lock_free.c.
References NO_ERROR.
unsigned int lf_callback_vpid_hash | ( | void * | vpid, |
int | htsize | ||
) |
Definition at line 140 of file lock_free.c.
References vpid::pageid, and vpid::volid.
void lf_destroy_transaction_systems | ( | void | ) |
Definition at line 520 of file lock_free.c.
References lf_tran_system_destroy(), and tran_systems_initialized.
Referenced by boot_server_all_finalize(), and lf_initialize_transaction_systems().
void* lf_freelist_claim | ( | LF_TRAN_ENTRY * | tran_entry, |
LF_FREELIST * | freelist | ||
) |
Definition at line 751 of file lock_free.c.
References assert, lf_freelist::available, lf_freelist::available_cnt, lf_freelist::entry_desc, lf_entry_descriptor::f_init, lf_claims, lf_claims_temp, lf_freelist_alloc_block(), lf_freelist_transport(), LF_NULL_TRANSACTION_ID, lf_stack_pop(), lf_temps, LF_TRAN_CLEANUP_NECESSARY, lf_tran_end_with_mb, lf_tran_start_with_mb, LF_UNITTEST_INC, NO_ERROR, NULL, OF_GET_PTR_DEREF, lf_entry_descriptor::of_next, lf_tran_entry::temp_entry, and lf_tran_entry::transaction_id.
Referenced by lf_hash_table_cpp< Key, T >::freelist_claim(), lf_list_insert_internal(), lock_rep_read_tran(), qfile_allocate_sort_list(), test_freelist_proc(), and test_freelist_proc_local_tran().
void lf_freelist_destroy | ( | LF_FREELIST * | freelist | ) |
Definition at line 711 of file lock_free.c.
References assert, lf_freelist::available, lf_freelist::entry_desc, lf_entry_descriptor::f_free, NULL, OF_GET_PTR_DEREF, and lf_entry_descriptor::of_local_next.
Referenced by lf_hash_table_cpp< Key, T >::destroy(), fpcache_initialize(), heap_finalize_hfid_table(), lock_finalize(), logtb_finalize_global_unique_stats_table(), qfile_finalize(), and test_freelist().
int lf_freelist_init | ( | LF_FREELIST * | freelist, |
int | initial_blocks, | ||
int | block_size, | ||
LF_ENTRY_DESCRIPTOR * | edesc, | ||
LF_TRAN_SYSTEM * | tran_system | ||
) |
Definition at line 666 of file lock_free.c.
References lf_freelist::alloc_cnt, assert, lf_freelist::available, lf_freelist::available_cnt, lf_freelist::block_size, lf_tran_system::entry_desc, lf_freelist::entry_desc, ER_FAILED, i, lf_freelist_alloc_block(), NO_ERROR, NULL, lf_freelist::retired_cnt, and lf_freelist::tran_system.
Referenced by heap_initialize_hfid_table(), lf_hash_table_cpp< Key, T >::lf_hash_table_cpp(), logtb_initialize_global_unique_stats_table(), qfile_initialize(), and test_freelist().
int lf_freelist_retire | ( | LF_TRAN_ENTRY * | tran_entry, |
LF_FREELIST * | freelist, | ||
void * | entry | ||
) |
Definition at line 864 of file lock_free.c.
References assert, lf_tran_entry::did_incr, lf_freelist::entry_desc, ER_FAILED, lf_freelist_transport(), LF_NULL_TRANSACTION_ID, lf_retires, lf_stack_push(), LF_TRAN_CLEANUP_NECESSARY, lf_tran_end_with_mb, lf_tran_start_with_mb, LF_UNITTEST_INC, NO_ERROR, NULL, lf_entry_descriptor::of_del_tran_id, OF_GET_PTR, lf_freelist::retired_cnt, lf_tran_entry::retired_list, and lf_tran_entry::transaction_id.
Referenced by lf_hash_table_cpp< Key, T >::freelist_retire(), lf_list_delete(), lf_list_insert_internal(), lock_rep_read_tran(), qfile_free_sort_list(), test_freelist_proc(), and test_freelist_proc_local_tran().
int lf_freelist_transport | ( | LF_TRAN_ENTRY * | tran_entry, |
LF_FREELIST * | freelist | ||
) |
Definition at line 930 of file lock_free.c.
References assert, lf_freelist::available, lf_freelist::available_cnt, lf_freelist::entry_desc, lf_entry_descriptor::f_uninit, lf_tran_entry::last_cleanup_id, lf_transports, LF_UNITTEST_INC, lf_tran_system::min_active_transaction_id, NO_ERROR, NULL, lf_entry_descriptor::of_del_tran_id, OF_GET_PTR, OF_GET_PTR_DEREF, lf_entry_descriptor::of_local_next, lf_freelist::retired_cnt, lf_tran_entry::retired_list, lf_tran_entry::tran_system, and VOLATILE_ACCESS.
Referenced by lf_freelist_claim(), and lf_freelist_retire().
void lf_hash_clear | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table | ||
) |
Definition at line 2246 of file lock_free.c.
References ADDR_STRIP_MARK, ADDR_WITH_MARK, assert, lf_hash_table::backbuffer, lf_hash_table::backbuffer_mutex, lf_hash_table::buckets, lf_hash_table::entry_desc, lf_hash_table::freelist, lf_hash_table::hash_size, i, lf_clears, lf_hash_size, lf_tran_end_with_mb, lf_tran_start_with_mb, LF_UNITTEST_INC, NULL, lf_entry_descriptor::of_del_tran_id, OF_GET_PTR, OF_GET_PTR_DEREF, OF_GET_REF, lf_entry_descriptor::of_local_next, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, pthread_mutex_lock, pthread_mutex_unlock, lf_freelist::retired_cnt, lf_tran_entry::retired_list, rv, lf_tran_entry::transaction_id, lf_entry_descriptor::using_mutex, and VOLATILE_ACCESS.
Referenced by lf_hash_table_cpp< Key, T >::clear().
void lf_hash_create_iterator | ( | LF_HASH_TABLE_ITERATOR * | iterator, |
LF_TRAN_ENTRY * | tran_entry, | ||
LF_HASH_TABLE * | table | ||
) |
Definition at line 2368 of file lock_free.c.
References assert, lf_hash_table_iterator::bucket_index, lf_hash_table_iterator::curr, lf_hash_table_iterator::hash_table, NULL, and lf_hash_table_iterator::tran_entry.
Referenced by lf_hash_table_cpp< Key, T >::iterator::iterator(), and logtb_reflect_global_unique_stats_to_btree().
int lf_hash_delete | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
int * | success | ||
) |
Definition at line 2181 of file lock_free.c.
References lf_hash_delete_internal(), LF_LIST_BF_LOCK_ON_DELETE, LF_LIST_BF_RETURN_ON_RESTART, and NULL.
Referenced by lf_hash_table_cpp< Key, T >::erase(), heap_cache_class_info(), heap_delete_hfid_from_cache(), heap_hfid_cache_get(), and logtb_delete_global_unique_stats().
int lf_hash_delete_already_locked | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
void * | locked_entry, | ||
int * | success | ||
) |
Definition at line 2164 of file lock_free.c.
References assert, lf_hash_table::entry_desc, lf_hash_delete_internal(), LF_LIST_BF_RETURN_ON_RESTART, NULL, and lf_entry_descriptor::using_mutex.
Referenced by lf_hash_table_cpp< Key, T >::erase_locked().
void lf_hash_destroy | ( | LF_HASH_TABLE * | table | ) |
Definition at line 1933 of file lock_free.c.
References lf_hash_table::backbuffer, lf_hash_table::backbuffer_mutex, lf_hash_table::buckets, lf_hash_table::entry_desc, lf_entry_descriptor::f_free, lf_entry_descriptor::f_uninit, lf_hash_table::hash_size, i, NULL, OF_GET_PTR_DEREF, lf_entry_descriptor::of_next, and pthread_mutex_destroy.
Referenced by lf_hash_table_cpp< Key, T >::destroy(), fpcache_initialize(), heap_finalize_hfid_table(), heap_initialize_hfid_table(), logtb_finalize_global_unique_stats_table(), and logtb_initialize_global_unique_stats_table().
int lf_hash_find | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
void ** | entry | ||
) |
Definition at line 1987 of file lock_free.c.
References assert, lf_hash_table::buckets, lf_hash_table::entry_desc, ER_FAILED, lf_entry_descriptor::f_hash, lf_hash_table::hash_size, LF_LIST_BF_RETURN_ON_RESTART, LF_LIST_BR_RESTARTED, lf_list_find(), NO_ERROR, NULL, and rc.
Referenced by lf_hash_table_cpp< Key, T >::find(), and logtb_get_global_unique_stats_entry().
int lf_hash_find_or_insert | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
void ** | entry, | ||
int * | inserted | ||
) |
Definition at line 2101 of file lock_free.c.
References lf_hash_insert_internal(), LF_LIST_BF_FIND_OR_INSERT, and LF_LIST_BF_RETURN_ON_RESTART.
Referenced by lf_hash_table_cpp< Key, T >::find_or_insert(), heap_cache_class_info(), heap_hfid_cache_get(), and logtb_get_global_unique_stats_entry().
int lf_hash_init | ( | LF_HASH_TABLE * | table, |
LF_FREELIST * | freelist, | ||
unsigned int | hash_size, | ||
LF_ENTRY_DESCRIPTOR * | edesc | ||
) |
Definition at line 1873 of file lock_free.c.
References ADDR_WITH_MARK, ARG_FILE_LINE, assert, lf_hash_table::backbuffer, lf_hash_table::backbuffer_mutex, lf_hash_table::buckets, lf_hash_table::entry_desc, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), lf_hash_table::freelist, lf_hash_table::hash_size, i, NO_ERROR, NULL, and pthread_mutex_init.
Referenced by heap_initialize_hfid_table(), lf_hash_table_cpp< Key, T >::lf_hash_table_cpp(), and logtb_initialize_global_unique_stats_table().
int lf_hash_insert | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
void ** | entry, | ||
int * | inserted | ||
) |
Definition at line 2118 of file lock_free.c.
References lf_hash_insert_internal(), and LF_LIST_BF_RETURN_ON_RESTART.
Referenced by lf_hash_table_cpp< Key, T >::insert().
int lf_hash_insert_given | ( | LF_TRAN_ENTRY * | tran, |
LF_HASH_TABLE * | table, | ||
void * | key, | ||
void ** | entry, | ||
int * | inserted | ||
) |
Definition at line 2134 of file lock_free.c.
References assert, lf_hash_insert_internal(), LF_LIST_BF_FIND_OR_INSERT, LF_LIST_BF_INSERT_GIVEN, LF_LIST_BF_RETURN_ON_RESTART, and NULL.
Referenced by lf_hash_table_cpp< Key, T >::insert_given().
void* lf_hash_iterate | ( | LF_HASH_TABLE_ITERATOR * | it | ) |
Definition at line 2388 of file lock_free.c.
References ADDR_HAS_MARK, ADDR_STRIP_MARK, assert, lf_hash_table_iterator::bucket_index, lf_hash_table::buckets, lf_hash_table_iterator::curr, lf_hash_table::entry_desc, lf_hash_table::hash_size, lf_hash_table_iterator::hash_table, lf_claims, lf_claims_temp, lf_clears, lf_deletes, lf_deletes_restart, lf_hash_size, lf_inserts, lf_inserts_restart, lf_list_deletes, lf_list_deletes_fail_mark_next, lf_list_deletes_fail_unlink, lf_list_deletes_found, lf_list_deletes_not_found, lf_list_deletes_not_match, lf_list_deletes_success_unlink, lf_list_inserts, lf_list_inserts_claim, lf_list_inserts_fail_link, lf_list_inserts_found, lf_list_inserts_save_temp_1, lf_list_inserts_save_temp_2, lf_list_inserts_success_link, lf_retires, lf_temps, lf_tran_end_with_mb, lf_tran_start_with_mb, lf_transports, NULL, OF_GET_PTR, OF_GET_PTR_DEREF, OF_GET_REF, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, pthread_mutex_lock, pthread_mutex_unlock, rv, lf_hash_table_iterator::tran_entry, lf_entry_descriptor::using_mutex, and VOLATILE_ACCESS.
Referenced by lf_hash_table_cpp< Key, T >::iterator::iterate(), and logtb_reflect_global_unique_stats_to_btree().
int lf_initialize_transaction_systems | ( | int | max_threads | ) |
Definition at line 448 of file lock_free.c.
References ER_FAILED, error(), lf_destroy_transaction_systems(), lf_tran_system_init(), NO_ERROR, and tran_systems_initialized.
Referenced by cubthread::initialize_thread_entries().
int lf_io_list_find | ( | void ** | list_p, |
void * | key, | ||
LF_ENTRY_DESCRIPTOR * | edesc, | ||
void ** | entry | ||
) |
Definition at line 1047 of file lock_free.c.
References assert, lf_entry_descriptor::f_key_cmp, NO_ERROR, NULL, OF_GET_PTR, OF_GET_REF, lf_entry_descriptor::of_key, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, pthread_mutex_lock, rv, and lf_entry_descriptor::using_mutex.
int lf_io_list_find_or_insert | ( | void ** | list_p, |
void * | new_entry, | ||
LF_ENTRY_DESCRIPTOR * | edesc, | ||
void ** | entry | ||
) |
Definition at line 1101 of file lock_free.c.
References assert, ER_FAILED, lf_entry_descriptor::f_key_cmp, NO_ERROR, NULL, OF_GET_PTR, OF_GET_REF, lf_entry_descriptor::of_key, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, pthread_mutex_lock, pthread_mutex_unlock, rv, and lf_entry_descriptor::using_mutex.
int lf_list_delete | ( | LF_TRAN_ENTRY * | tran, |
void ** | list_p, | ||
void * | key, | ||
void * | locked_entry, | ||
int * | behavior_flags, | ||
LF_ENTRY_DESCRIPTOR * | edesc, | ||
LF_FREELIST * | freelist, | ||
int * | success | ||
) |
Definition at line 1634 of file lock_free.c.
References ADDR_STRIP_MARK, ADDR_WITH_MARK, assert, ER_FAILED, lf_entry_descriptor::f_key_cmp, LF_END_TRAN_FORCE, lf_freelist_retire(), lf_hash_size, LF_LIST_BF_IS_FLAG_SET, LF_LIST_BF_LOCK_ON_DELETE, LF_LIST_BF_RETURN_ON_RESTART, LF_LIST_BR_RESTARTED, lf_list_deletes, lf_list_deletes_fail_mark_next, lf_list_deletes_fail_unlink, lf_list_deletes_found, lf_list_deletes_not_found, lf_list_deletes_not_match, lf_list_deletes_success_unlink, LF_LOCK_ENTRY, LF_PROMOTE_TRAN_FORCE, LF_START_TRAN_FORCE, LF_UNITTEST_INC, LF_UNLOCK_ENTRY_FORCE, NO_ERROR, NULL, OF_GET_PTR, OF_GET_REF, lf_entry_descriptor::of_key, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, rv, lf_tran_entry::tran_system, and lf_entry_descriptor::using_mutex.
Referenced by lf_hash_delete_internal().
int lf_list_find | ( | LF_TRAN_ENTRY * | tran, |
void ** | list_p, | ||
void * | key, | ||
int * | behavior_flags, | ||
LF_ENTRY_DESCRIPTOR * | edesc, | ||
void ** | entry | ||
) |
Definition at line 1191 of file lock_free.c.
References ADDR_HAS_MARK, ADDR_STRIP_MARK, assert, lf_entry_descriptor::f_key_cmp, LF_LIST_BF_RETURN_ON_RESTART, LF_LIST_BR_RESTARTED, lf_tran_end_with_mb, lf_tran_start_with_mb, NO_ERROR, NULL, OF_GET_PTR, OF_GET_PTR_DEREF, OF_GET_REF, lf_entry_descriptor::of_key, lf_entry_descriptor::of_mutex, lf_entry_descriptor::of_next, pthread_mutex_lock, pthread_mutex_unlock, rv, and lf_entry_descriptor::using_mutex.
Referenced by lf_hash_find().
void* lf_stack_pop | ( | void ** | top, |
LF_ENTRY_DESCRIPTOR * | edesc | ||
) |
Definition at line 575 of file lock_free.c.
References assert, NULL, OF_GET_PTR_DEREF, and lf_entry_descriptor::of_local_next.
Referenced by lf_freelist_claim().
int lf_stack_push | ( | void ** | top, |
void * | entry, | ||
LF_ENTRY_DESCRIPTOR * | edesc | ||
) |
Definition at line 545 of file lock_free.c.
References assert, NO_ERROR, NULL, OF_GET_PTR_DEREF, and lf_entry_descriptor::of_local_next.
Referenced by lf_freelist_retire().
void lf_tran_compute_minimum_transaction_id | ( | LF_TRAN_SYSTEM * | sys | ) |
Definition at line 369 of file lock_free.c.
References lockfree::bitmap::bitfield, lf_tran_system::entries, lf_tran_system::entry_count, i, LF_BITFIELD_WORD_SIZE, lf_tran_system::lf_bitmap, LF_NULL_TRANSACTION_ID, lf_tran_system::min_active_transaction_id, and lf_tran_entry::transaction_id.
Referenced by lf_tran_start().
void lf_tran_destroy_entry | ( | LF_TRAN_ENTRY * | entry | ) |
Definition at line 336 of file lock_free.c.
References assert, lf_tran_system::entry_desc, lf_entry_descriptor::f_free, lf_entry_descriptor::f_uninit, NULL, OF_GET_PTR_DEREF, lf_entry_descriptor::of_local_next, lf_tran_entry::retired_list, and lf_tran_entry::tran_system.
Referenced by lf_tran_system_destroy().
void lf_tran_end | ( | LF_TRAN_ENTRY * | entry | ) |
Definition at line 436 of file lock_free.c.
References assert, lf_tran_entry::did_incr, LF_NULL_TRANSACTION_ID, and lf_tran_entry::transaction_id.
LF_TRAN_ENTRY* lf_tran_request_entry | ( | LF_TRAN_SYSTEM * | sys | ) |
Definition at line 271 of file lock_free.c.
References assert, lf_tran_system::entries, lf_tran_system::entry_count, lockfree::bitmap::get_entry(), lf_tran_system::lf_bitmap, LF_NULL_TRANSACTION_ID, NULL, lf_tran_entry::transaction_id, and lf_tran_system::used_entry_count.
Referenced by cubthread::entry::request_lock_free_transactions(), test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), test_freelist_proc(), test_freelist_proc_local_tran(), test_hash_iterator(), test_hash_proc_1(), test_hash_proc_2(), and test_hash_proc_3().
void lf_tran_return_entry | ( | LF_TRAN_ENTRY * | entry | ) |
Definition at line 310 of file lock_free.c.
References assert, lf_tran_entry::entry_idx, lockfree::bitmap::free_entry(), lf_tran_system::lf_bitmap, LF_NULL_TRANSACTION_ID, NULL, lf_tran_entry::tran_system, lf_tran_entry::transaction_id, and lf_tran_system::used_entry_count.
Referenced by cubthread::entry::return_lock_free_transaction_entries(), test_clear_proc_1(), test_clear_proc_2(), test_clear_proc_3(), test_freelist_proc(), test_freelist_proc_local_tran(), test_hash_iterator(), test_hash_proc_1(), test_hash_proc_2(), and test_hash_proc_3().
void lf_tran_start | ( | LF_TRAN_ENTRY * | entry, |
bool | incr | ||
) |
Definition at line 403 of file lock_free.c.
References assert, lf_tran_entry::did_incr, lf_tran_system::global_transaction_id, LF_NULL_TRANSACTION_ID, lf_tran_compute_minimum_transaction_id(), lf_tran_system::mati_refresh_interval, NULL, lf_tran_entry::tran_system, lf_tran_entry::transaction_id, and VOLATILE_ACCESS.
void lf_tran_system_destroy | ( | LF_TRAN_SYSTEM * | sys | ) |
Definition at line 240 of file lock_free.c.
References assert, lockfree::bitmap::destroy(), lf_tran_system::entries, lf_tran_system::entry_count, lf_tran_system::entry_desc, free_and_init, i, lf_tran_system::lf_bitmap, lf_tran_destroy_entry(), and NULL.
Referenced by lf_destroy_transaction_systems(), test_freelist(), test_hash_iterator(), and test_hash_table().
int lf_tran_system_init | ( | LF_TRAN_SYSTEM * | sys, |
int | max_threads | ||
) |
Definition at line 184 of file lock_free.c.
References ARG_FILE_LINE, assert, lockfree::bitmap::destroy(), lf_tran_entry::did_incr, lf_tran_system::entries, lf_tran_system::entry_count, lf_tran_entry::entry_idx, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), lf_tran_system::global_transaction_id, i, lockfree::bitmap::init(), lf_tran_entry::last_cleanup_id, lf_tran_system::lf_bitmap, LF_BITMAP_COUNT_ALIGN, LF_BITMAP_FULL_USAGE_RATIO, LF_BITMAP_ONE_CHUNK, LF_NULL_TRANSACTION_ID, lf_tran_system::mati_refresh_interval, lf_tran_system::min_active_transaction_id, NO_ERROR, NULL, lf_tran_entry::retired_list, lf_tran_entry::temp_entry, lf_tran_entry::tran_system, lf_tran_entry::transaction_id, and lf_tran_system::used_entry_count.
Referenced by lf_initialize_transaction_systems(), test_freelist(), test_hash_iterator(), and test_hash_table().
LF_TRAN_SYSTEM catalog_Ts |
Definition at line 49 of file lock_free.c.
Referenced by catalog_initialize(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM dwb_slots_Ts |
Definition at line 56 of file lock_free.c.
Referenced by dwb_create_internal(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM fpcache_Ts |
Definition at line 55 of file lock_free.c.
Referenced by fpcache_initialize(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM free_sort_list_Ts |
Definition at line 51 of file lock_free.c.
Referenced by qfile_initialize(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM global_unique_stats_Ts |
Definition at line 52 of file lock_free.c.
Referenced by logtb_initialize_global_unique_stats_table(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM hfid_table_Ts |
Definition at line 53 of file lock_free.c.
Referenced by heap_initialize_hfid_table(), and cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM obj_lock_ent_Ts |
Definition at line 48 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM obj_lock_res_Ts |
Definition at line 47 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM sessions_Ts |
Definition at line 50 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions(), and session_states_init().
LF_TRAN_SYSTEM spage_saving_Ts |
Definition at line 46 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions(), and spage_boot().
LF_TRAN_SYSTEM xcache_Ts |
Definition at line 54 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions(), and xcache_initialize().