17 "N",
"IS",
"IX",
"S",
"SIX",
"X" 45 #define T true // to make following easier to read 195 return reinterpret_cast<const uint64_t*
>(
modes)[part /
WORD_SIZE];
221 part +=
sizeof(uint64_t) - 1;
232 modes[partition] = (
unsigned char)mode;
288 uint64_t requested_batch = requested.
_get_batch64(part);
290 if (requested_batch == 0 || granted_batch == 0) {
322 if (this_batch == 0 || this_batch == superset_batch) {
337 const uint32_t HASH_SEED_32 = 0x35D0B891;
338 const unsigned char HASH_SEED_8 = 0xDB;
339 const int W =
sizeof(uint32_t);
341 for (
int word = 0; word < uniquefier_length / W; ++word) {
342 hash = (hash * HASH_SEED_32) + reinterpret_cast<const uint32_t*>(uniquefier)[word];
345 for (
int remaining = uniquefier_length / W * W; remaining < uniquefier_length; ++remaining) {
346 hash = (hash * HASH_SEED_8) + reinterpret_cast<const unsigned char*>(uniquefier)[remaining];
373 if (left_batch == 0 || right_batch == 0 || left_batch == right_batch) {
374 uint64_t result_batch = 0;
375 if (left_batch == 0) {
376 result_batch = right_batch;
377 }
else if (right_batch == 0) {
380 result_batch = left_batch;
435 #endif // __W_OKVL_INL_H std::ostream & operator<<(std::ostream &o, const okvl_mode &v)
Definition: w_okvl_inl.h:416
element_lock_mode get_gap_mode() const
Definition: w_okvl_inl.h:170
void set_key_mode(element_lock_mode mode)
Definition: w_okvl_inl.h:239
unsigned char modes[OKVL_MODE_COUNT]
Definition: w_okvl.h:122
void set_partition_mode(part_id partition, element_lock_mode mode)
Definition: w_okvl_inl.h:231
const okvl_mode ALL_X_GAP_X(okvl_mode::X, okvl_mode::X)
bool operator==(const okvl_mode &r) const
Definition: w_okvl_inl.h:398
const bool implication_table[okvl_mode::COUNT][okvl_mode::COUNT]
Definition: w_okvl_inl.h:71
uint64_t & _get_batch64_ref(part_id part)
Definition: w_okvl_inl.h:198
bool is_compatible_request(const okvl_mode &requested) const
Definition: w_okvl_inl.h:251
bool is_empty() const
Definition: w_okvl_inl.h:174
static bool is_implied_by_element(element_lock_mode left, element_lock_mode right)
Definition: w_okvl_inl.h:128
element_lock_mode get_key_mode() const
Definition: w_okvl_inl.h:166
#define F
Definition: w_okvl_inl.h:46
const bool compatibility_table[okvl_mode::COUNT][okvl_mode::COUNT]
Definition: w_okvl_inl.h:52
static bool is_compatible(const okvl_mode &requested, const okvl_mode &granted)
Definition: w_okvl_inl.h:261
element_lock_mode
Lock mode for one OKVL component (key, partition, or gap).
Definition: w_okvl.h:107
static bool is_compatible_element(element_lock_mode requested, element_lock_mode granted)
Definition: w_okvl_inl.h:122
const okvl_mode ALL_S_GAP_S(okvl_mode::S, okvl_mode::S)
bool contains_dirty_lock() const
Returns whether this contains any lock mode that implies data update directly in the resource this lo...
Definition: w_okvl_inl.h:202
const uint32_t OKVL_MODE_COUNT
Definition: w_okvl.h:84
void clear()
Definition: w_okvl_inl.h:247
const char *const element_mode_names[]
Definition: w_okvl_inl.h:16
bool is_keylock_empty() const
Definition: w_okvl_inl.h:180
bool is_implied_by(const okvl_mode &superset) const
Definition: w_okvl_inl.h:305
const okvl_mode ALL_S_GAP_N(okvl_mode::S, okvl_mode::N)
uint16_t part_id
Definition: w_okvl.h:97
element_lock_mode get_partition_mode(part_id partition) const
Definition: w_okvl_inl.h:162
const okvl_mode ALL_X_GAP_N(okvl_mode::X, okvl_mode::N)
const okvl_mode ALL_S_GAP_X(okvl_mode::S, okvl_mode::X)
okvl_mode()
Definition: w_okvl_inl.h:134
okvl_mode & operator=(const okvl_mode &r)
Definition: w_okvl_inl.h:142
bool is_keylock_partition_empty() const
Definition: w_okvl_inl.h:185
const okvl_mode ALL_N_GAP_S(okvl_mode::N, okvl_mode::S)
Represents a lock mode of one key entry in the OKVL lock manager.
Definition: w_okvl.h:95
const okvl_mode::element_lock_mode parent_lock_mode[]
Definition: w_okvl_inl.h:93
uint64_t _get_batch64(part_id part) const
Definition: w_okvl_inl.h:194
bool is_compatible_grant(const okvl_mode &granted) const
Definition: w_okvl_inl.h:256
static okvl_mode combine(const okvl_mode &left, const okvl_mode &right)
Definition: w_okvl_inl.h:353
bool contains_dirty_key_lock() const
Definition: w_okvl_inl.h:213
static bool _can_batch64(part_id part)
Definition: w_okvl_inl.h:190
const uint32_t OKVL_PARTITIONS
The number of partitions in OKVL.
Definition: w_okvl.h:78
bool operator!=(const okvl_mode &r) const
Definition: w_okvl_inl.h:412
static part_id compute_part_id(const void *uniquefier, int uniquefier_length)
Definition: w_okvl_inl.h:336
const okvl_mode::element_lock_mode combined_lock_modes[okvl_mode::COUNT][okvl_mode::COUNT]
Definition: w_okvl_inl.h:107
const okvl_mode ALL_N_GAP_X(okvl_mode::N, okvl_mode::X)
const okvl_mode ALL_N_GAP_N(okvl_mode::N, okvl_mode::N)
Pre-defines frequently used lock modes as const objects.
void set_gap_mode(element_lock_mode mode)
Definition: w_okvl_inl.h:243
#define T
Definition: w_okvl_inl.h:45
const okvl_mode ALL_X_GAP_S(okvl_mode::X, okvl_mode::S)