CUBRID Engine
latest
|
#include "config.h"
#include <assert.h>
#include "porting.h"
#include "lock_free.h"
#include "error_manager.h"
#include "error_code.h"
#include "memory_alloc.h"
Go to the source code of this file.
Macros | |
#define | pthread_mutex_init(a, b) |
#define | pthread_mutex_destroy(a) |
#define | pthread_mutex_lock(a) 0 |
#define | pthread_mutex_trylock(a) 0 |
#define | pthread_mutex_unlock(a) |
#define | OF_GET_REF(p, o) (void * volatile *) (((char *)(p)) + (o)) |
#define | OF_GET_PTR(p, o) (void *) (((char *)(p)) + (o)) |
#define | OF_GET_PTR_DEREF(p, o) (*OF_GET_REF (p,o)) |
#define | ADDR_HAS_MARK(p) (((long long volatile) (p)) & 0x1) |
#define | ADDR_WITH_MARK(p) ((void * volatile) (((long long volatile) (p)) | 0x1)) |
#define | ADDR_STRIP_MARK(p) ((void * volatile) (((long long volatile) (p)) & (~((long long) 0x1)))) |
#define | LF_UNITTEST_INC(lf_stat, incval) |
#define | LF_ASSERT_USE_MUTEX_OR_TRAN_STARTED() |
#define | LF_START_TRAN() if (!is_tran_started) lf_tran_start_with_mb (tran, false); is_tran_started = true |
#define | LF_START_TRAN_FORCE() assert (!is_tran_started); lf_tran_start_with_mb (tran, false); is_tran_started = true |
#define | LF_END_TRAN() if (is_tran_started) lf_tran_end_with_mb (tran) |
#define | LF_END_TRAN_FORCE() assert (is_tran_started); lf_tran_end_with_mb (tran); is_tran_started = false |
#define | LF_LOCK_ENTRY(tolock) |
#define | LF_UNLOCK_ENTRY() |
#define | LF_UNLOCK_ENTRY_FORCE() |
#define | LF_START_TRAN_FORCE() assert (!is_tran_started); lf_tran_start_with_mb (tran, false); is_tran_started = true |
#define | LF_PROMOTE_TRAN_FORCE() assert (is_tran_started); MEMORY_BARRIER (); lf_tran_start_with_mb (tran, true) |
#define | LF_END_TRAN_FORCE() assert (is_tran_started); lf_tran_end_with_mb (tran); is_tran_started = false |
#define | LF_LOCK_ENTRY(tolock) |
#define | LF_UNLOCK_ENTRY_FORCE() |
Functions | |
static int | lf_list_insert_internal (LF_TRAN_ENTRY *tran, void **list_p, void *key, int *behavior_flags, LF_ENTRY_DESCRIPTOR *edesc, LF_FREELIST *freelist, void **entry, int *inserted) |
static int | lf_hash_insert_internal (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, int bflags, void **entry, int *inserted) |
static int | lf_hash_delete_internal (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void *locked_entry, int bflags, int *success) |
unsigned int | lf_callback_vpid_hash (void *vpid, int htsize) |
int | lf_callback_vpid_compare (void *vpid_1, void *vpid_2) |
int | lf_callback_vpid_copy (void *src, void *dest) |
int | lf_tran_system_init (LF_TRAN_SYSTEM *sys, int max_threads) |
void | lf_tran_system_destroy (LF_TRAN_SYSTEM *sys) |
LF_TRAN_ENTRY * | lf_tran_request_entry (LF_TRAN_SYSTEM *sys) |
void | lf_tran_return_entry (LF_TRAN_ENTRY *entry) |
void | lf_tran_destroy_entry (LF_TRAN_ENTRY *entry) |
void | lf_tran_compute_minimum_transaction_id (LF_TRAN_SYSTEM *sys) |
void | lf_tran_start (LF_TRAN_ENTRY *entry, bool incr) |
void | lf_tran_end (LF_TRAN_ENTRY *entry) |
int | lf_initialize_transaction_systems (int max_threads) |
void | lf_destroy_transaction_systems (void) |
int | lf_stack_push (void **top, void *entry, LF_ENTRY_DESCRIPTOR *edesc) |
void * | lf_stack_pop (void **top, LF_ENTRY_DESCRIPTOR *edesc) |
static int | lf_freelist_alloc_block (LF_FREELIST *freelist) |
int | lf_freelist_init (LF_FREELIST *freelist, int initial_blocks, int block_size, LF_ENTRY_DESCRIPTOR *edesc, LF_TRAN_SYSTEM *tran_system) |
void | lf_freelist_destroy (LF_FREELIST *freelist) |
void * | lf_freelist_claim (LF_TRAN_ENTRY *tran_entry, LF_FREELIST *freelist) |
int | lf_freelist_retire (LF_TRAN_ENTRY *tran_entry, LF_FREELIST *freelist, void *entry) |
int | lf_freelist_transport (LF_TRAN_ENTRY *tran_entry, LF_FREELIST *freelist) |
int | lf_io_list_find (void **list_p, void *key, LF_ENTRY_DESCRIPTOR *edesc, void **entry) |
int | lf_io_list_find_or_insert (void **list_p, void *new_entry, LF_ENTRY_DESCRIPTOR *edesc, void **entry) |
int | lf_list_find (LF_TRAN_ENTRY *tran, void **list_p, void *key, int *behavior_flags, LF_ENTRY_DESCRIPTOR *edesc, void **entry) |
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) |
int | lf_hash_init (LF_HASH_TABLE *table, LF_FREELIST *freelist, unsigned int hash_size, LF_ENTRY_DESCRIPTOR *edesc) |
void | lf_hash_destroy (LF_HASH_TABLE *table) |
int | lf_hash_find (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void **entry) |
int | lf_hash_find_or_insert (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void **entry, int *inserted) |
int | lf_hash_insert (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void **entry, int *inserted) |
int | lf_hash_insert_given (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void **entry, int *inserted) |
int | lf_hash_delete_already_locked (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, void *locked_entry, int *success) |
int | lf_hash_delete (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table, void *key, int *success) |
void | lf_hash_clear (LF_TRAN_ENTRY *tran, LF_HASH_TABLE *table) |
void | lf_hash_create_iterator (LF_HASH_TABLE_ITERATOR *iterator, LF_TRAN_ENTRY *tran_entry, LF_HASH_TABLE *table) |
void * | lf_hash_iterate (LF_HASH_TABLE_ITERATOR *it) |
Definition at line 70 of file lock_free.c.
Referenced by lf_hash_iterate(), lf_list_find(), and lf_list_insert_internal().
#define ADDR_STRIP_MARK | ( | p | ) | ((void * volatile) (((long long volatile) (p)) & (~((long long) 0x1)))) |
Definition at line 72 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_list_delete(), lf_list_find(), and lf_list_insert_internal().
Definition at line 71 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_init(), and lf_list_delete().
#define LF_ASSERT_USE_MUTEX_OR_TRAN_STARTED | ( | ) |
Referenced by lf_list_insert_internal().
#define LF_END_TRAN | ( | ) | if (is_tran_started) lf_tran_end_with_mb (tran) |
Referenced by lf_list_insert_internal().
#define LF_END_TRAN_FORCE | ( | ) | assert (is_tran_started); lf_tran_end_with_mb (tran); is_tran_started = false |
Referenced by lf_list_delete(), and lf_list_insert_internal().
#define LF_END_TRAN_FORCE | ( | ) | assert (is_tran_started); lf_tran_end_with_mb (tran); is_tran_started = false |
#define LF_LOCK_ENTRY | ( | tolock | ) |
Referenced by lf_list_delete(), and lf_list_insert_internal().
#define LF_LOCK_ENTRY | ( | tolock | ) |
#define LF_PROMOTE_TRAN_FORCE | ( | ) | assert (is_tran_started); MEMORY_BARRIER (); lf_tran_start_with_mb (tran, true) |
Referenced by lf_list_delete().
#define LF_START_TRAN | ( | ) | if (!is_tran_started) lf_tran_start_with_mb (tran, false); is_tran_started = true |
#define LF_START_TRAN_FORCE | ( | ) | assert (!is_tran_started); lf_tran_start_with_mb (tran, false); is_tran_started = true |
Referenced by lf_list_delete(), and lf_list_insert_internal().
#define LF_START_TRAN_FORCE | ( | ) | assert (!is_tran_started); lf_tran_start_with_mb (tran, false); is_tran_started = true |
#define LF_UNITTEST_INC | ( | lf_stat, | |
incval | |||
) |
Definition at line 115 of file lock_free.c.
Referenced by lf_freelist_claim(), lf_freelist_retire(), lf_freelist_transport(), lf_hash_clear(), lf_hash_delete_internal(), lf_hash_insert_internal(), lf_list_delete(), and lf_list_insert_internal().
#define LF_UNLOCK_ENTRY | ( | ) |
Referenced by lf_list_insert_internal().
#define LF_UNLOCK_ENTRY_FORCE | ( | ) |
Referenced by lf_list_delete(), and lf_list_insert_internal().
#define LF_UNLOCK_ENTRY_FORCE | ( | ) |
Definition at line 64 of file lock_free.c.
Referenced by lf_freelist_retire(), lf_freelist_transport(), lf_hash_clear(), lf_hash_iterate(), lf_io_list_find(), lf_io_list_find_or_insert(), lf_list_delete(), lf_list_find(), and lf_list_insert_internal().
#define OF_GET_PTR_DEREF | ( | p, | |
o | |||
) | (*OF_GET_REF (p,o)) |
Definition at line 65 of file lock_free.c.
Referenced by lf_freelist_alloc_block(), lf_freelist_claim(), lf_freelist_destroy(), lf_freelist_transport(), lf_hash_clear(), lf_hash_destroy(), lf_hash_iterate(), lf_list_find(), lf_list_insert_internal(), lf_stack_pop(), lf_stack_push(), and lf_tran_destroy_entry().
Definition at line 63 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_io_list_find(), lf_io_list_find_or_insert(), lf_list_delete(), lf_list_find(), and lf_list_insert_internal().
#define pthread_mutex_destroy | ( | a | ) |
Definition at line 36 of file lock_free.c.
Referenced by lf_hash_destroy().
#define pthread_mutex_init | ( | a, | |
b | |||
) |
Definition at line 35 of file lock_free.c.
Referenced by lf_hash_init().
#define pthread_mutex_lock | ( | a | ) | 0 |
Definition at line 37 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_io_list_find(), lf_io_list_find_or_insert(), and lf_list_find().
#define pthread_mutex_trylock | ( | a | ) | 0 |
Definition at line 38 of file lock_free.c.
Referenced by pgbuf_is_hit_ratio_low().
#define pthread_mutex_unlock | ( | a | ) |
Definition at line 39 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_io_list_find_or_insert(), and lf_list_find().
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().
|
static |
Definition at line 611 of file lock_free.c.
References lf_freelist::alloc_cnt, ARG_FILE_LINE, assert, lf_freelist::available, lf_freelist::available_cnt, lf_freelist::block_size, lf_freelist::entry_desc, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), lf_entry_descriptor::f_alloc, i, NO_ERROR, NULL, OF_GET_PTR_DEREF, lf_entry_descriptor::of_local_next, and VOLATILE_ACCESS.
Referenced by lf_freelist_claim(), and lf_freelist_init().
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().
|
static |
Definition at line 2198 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::freelist, lf_hash_table::hash_size, lf_deletes, lf_deletes_restart, LF_LIST_BR_RESTARTED, lf_list_delete(), LF_UNITTEST_INC, NO_ERROR, NULL, and rc.
Referenced by lf_hash_delete(), and lf_hash_delete_already_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().
|
static |
Definition at line 2047 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::freelist, lf_hash_table::hash_size, lf_inserts, lf_inserts_restart, LF_LIST_BF_INSERT_GIVEN, LF_LIST_BF_IS_FLAG_SET, LF_LIST_BR_RESTARTED, lf_list_insert_internal(), LF_UNITTEST_INC, NO_ERROR, NULL, and rc.
Referenced by lf_hash_find_or_insert(), lf_hash_insert(), and lf_hash_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().
|
static |
Definition at line 1289 of file lock_free.c.
References ADDR_HAS_MARK, ADDR_STRIP_MARK, assert, ASSERT_ERROR, ER_FAILED, lf_entry_descriptor::f_duplicate, lf_entry_descriptor::f_key_cmp, lf_entry_descriptor::f_key_copy, LF_ASSERT_USE_MUTEX_OR_TRAN_STARTED, LF_END_TRAN, LF_END_TRAN_FORCE, lf_freelist_claim(), lf_freelist_retire(), lf_hash_size, LF_LIST_BF_FIND_OR_INSERT, LF_LIST_BF_INSERT_GIVEN, LF_LIST_BF_IS_FLAG_SET, LF_LIST_BF_RESTART_ON_DUPLICATE, LF_LIST_BF_RETURN_ON_RESTART, LF_LIST_BR_RESTARTED, LF_LIST_BR_SET_FLAG, 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_LOCK_ENTRY, LF_START_TRAN_FORCE, lf_temps, LF_UNITTEST_INC, LF_UNLOCK_ENTRY, LF_UNLOCK_ENTRY_FORCE, NO_ERROR, NULL, OF_GET_PTR, OF_GET_PTR_DEREF, OF_GET_REF, lf_entry_descriptor::of_key, lf_entry_descriptor::of_next, rv, lf_tran_entry::temp_entry, and lf_entry_descriptor::using_mutex.
Referenced by lf_hash_insert_internal().
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 = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
Definition at line 53 of file lock_free.c.
Referenced by heap_initialize_hfid_table(), and cubthread::entry::request_lock_free_transactions().
|
static |
Definition at line 107 of file lock_free.c.
Referenced by lf_freelist_claim(), and lf_hash_iterate().
|
static |
Definition at line 108 of file lock_free.c.
Referenced by lf_freelist_claim(), and lf_hash_iterate().
|
static |
Definition at line 104 of file lock_free.c.
Referenced by lf_hash_clear(), and lf_hash_iterate().
|
static |
Definition at line 94 of file lock_free.c.
Referenced by lf_hash_delete_internal(), and lf_hash_iterate().
|
static |
Definition at line 95 of file lock_free.c.
Referenced by lf_hash_delete_internal(), and lf_hash_iterate().
|
static |
Definition at line 82 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_list_delete(), and lf_list_insert_internal().
|
static |
Definition at line 84 of file lock_free.c.
Referenced by lf_hash_insert_internal(), and lf_hash_iterate().
|
static |
Definition at line 85 of file lock_free.c.
Referenced by lf_hash_insert_internal(), and lf_hash_iterate().
|
static |
Definition at line 96 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 98 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 99 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 97 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 101 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 102 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 100 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_delete().
|
static |
Definition at line 86 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 90 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 91 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 87 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 88 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 89 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 92 of file lock_free.c.
Referenced by lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 106 of file lock_free.c.
Referenced by lf_freelist_retire(), and lf_hash_iterate().
|
static |
Definition at line 110 of file lock_free.c.
Referenced by lf_freelist_claim(), lf_hash_iterate(), and lf_list_insert_internal().
|
static |
Definition at line 109 of file lock_free.c.
Referenced by lf_freelist_transport(), and lf_hash_iterate().
LF_TRAN_SYSTEM obj_lock_ent_Ts = LF_TRAN_SYSTEM_INITIALIZER |
Definition at line 48 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions().
LF_TRAN_SYSTEM obj_lock_res_Ts = LF_TRAN_SYSTEM_INITIALIZER |
Definition at line 47 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions().
|
static |
Definition at line 40 of file lock_free.c.
Referenced by lf_hash_clear(), lf_hash_iterate(), lf_io_list_find(), lf_io_list_find_or_insert(), lf_list_delete(), lf_list_find(), and lf_list_insert_internal().
LF_TRAN_SYSTEM sessions_Ts = LF_TRAN_SYSTEM_INITIALIZER |
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 = LF_TRAN_SYSTEM_INITIALIZER |
Definition at line 46 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions(), and spage_boot().
|
static |
Definition at line 58 of file lock_free.c.
Referenced by lf_destroy_transaction_systems(), and lf_initialize_transaction_systems().
LF_TRAN_SYSTEM xcache_Ts = LF_TRAN_SYSTEM_INITIALIZER |
Definition at line 54 of file lock_free.c.
Referenced by cubthread::entry::request_lock_free_transactions(), and xcache_initialize().