This branch changes the way keys are generated.
Suppose there are N threads. Thread M will start to generate its key from M * std::numeric_limits<uint64_t>::max() / N.
List of main changes:
Add a cur_id_table array and a cur_id_start array to key_generator and current_id is not needed.
In operation-based mode., keys are now generated the same way as time-based mode.
Use only a (0,std::numeric_limits<uint64_t>::max())distribution and calculate mod to generate random number within range.
Todos:
Multithreaded benchmark can cause a very small portion of negative read/update ops if there are insert ops in the run phase. As the cur_id_table is doing a ++ before the key is inserted into the index.
OpenMP's parallel for omp for schedule() can not make sure the exact number of insertions for each thread in the load phase if num_records can not divide evenly to num_thread.
This branch changes the way keys are generated. Suppose there are N threads. Thread M will start to generate its key from
M * std::numeric_limits<uint64_t>::max() / N
.List of main changes:
(0,std::numeric_limits<uint64_t>::max())
distribution and calculate mod to generate random number within range.Todos:
omp for schedule()
can not make sure the exact number of insertions for each thread in the load phase if num_records can not divide evenly to num_thread.