|
Zero
0.1.0
|
LIL global lock table to protect Volume/Store from concurrent accesses. More...
#include <lock_lil.h>
Public Member Functions | |
| w_rc_t | request_lock (lil_lock_modes_t mode) |
| void | release_locks (bool *lock_taken, bool read_lock_only=false, lsn_t commit_lsn=lsn_t::null) |
Public Attributes | |
| uint16_t | _IS_count |
| uint16_t | _IX_count |
| uint16_t | _S_count |
| bool | _X_taken |
| bool | _dummy1 |
| uint16_t | _waiting_S |
| uint16_t | _waiting_X |
| uint32_t | _release_version |
| lsn_t | _x_lock_tag |
| pthread_mutex_t | _waiter_mutex |
| pthread_cond_t | _waiter_cond |
| tatas_lock | _spin_lock |
Private Member Functions | |
| w_rc_t | _request_lock_IS (lsn_t &observed_tag) |
| w_rc_t | _request_lock_IX (lsn_t &observed_tag) |
| w_rc_t | _request_lock_S (lsn_t &observed_tag) |
| w_rc_t | _request_lock_X (lsn_t &observed_tag) |
| bool | _cond_timedwait (uint32_t base_version, uint32_t timeout_microsec) |
LIL global lock table to protect Volume/Store from concurrent accesses.
This class provides a super-fast yet non-starving locks for classes that mainly have intent locks (IS/IX). As far as absolute locks (S/X) are rare, this performs way faster than usual lock tables which uses mutex and forms lock-chains to do inter-thread communications. This class only uses spinlocks, counters and sleeps. For more details, see jira ticket:94 "Lightweight Intent Lock (LIL)" (originally trac ticket:96).
|
private |
| void lil_global_table_base::release_locks | ( | bool * | lock_taken, |
| bool | read_lock_only = false, |
||
| lsn_t | commit_lsn = lsn_t::null |
||
| ) |
Decreases the corresponding counters. This never sees an error or long blocking.
| [in] | read_lock_only | if true, releases only read locks. default false. |
| w_rc_t lil_global_table_base::request_lock | ( | lil_lock_modes_t | mode | ) |
Requests the given mode in the lock table.
| [in] | mode | the lock mode to acquire |
| bool lil_global_table_base::_dummy1 |
| uint16_t lil_global_table_base::_IS_count |
| uint16_t lil_global_table_base::_IX_count |
| uint32_t lil_global_table_base::_release_version |
| uint16_t lil_global_table_base::_S_count |
| tatas_lock lil_global_table_base::_spin_lock |
all operations in this object are protected by this spin lock.
| pthread_cond_t lil_global_table_base::_waiter_cond |
| pthread_mutex_t lil_global_table_base::_waiter_mutex |
| uint16_t lil_global_table_base::_waiting_S |
| uint16_t lil_global_table_base::_waiting_X |
| lsn_t lil_global_table_base::_x_lock_tag |
| bool lil_global_table_base::_X_taken |
1.8.12