Clevel hashing is a lock-free PM hashing index with asynchronous resizing, which supports lock-free operations for search/insertion/update/deletion. This repository is the implementation of "Lock-free Concurrent Level Hashing for Persistent Memory", in Proceedings of the USENIX Annual Technical Conference (USENIX ATC), 2020.
We implement clevel hashing with PMDK and provide query interfaces similar to the concurrent_hash_map
in libpmemobj-cpp. The implementation and tests for clevel hashing are based on the libpmemobj-cpp (commit@26c86b4699).
- cmake >= 3.3
- libpmemobj-dev(el) >= 1.4 (http://pmem.io/pmdk/)
- compiler with C++11 support
We only ran our tests on Linux (Ubuntu 18.04). Run the following commands for compilation:
$ mkdir build
$ cd build
$ cmake ..
$ make -j
To compile with TBB enabled, please run the following commands:
$ mkdir build
$ cd build
$ cmake .. -DUSE_TBB=1
$ make -j
Please refer to the instructions for the use of test files.
- Current tests are used for the performance evaluation and not designed for
ctest
.
If you have any problems, please feel free to contact me.
- Zhangyu Chen (chenzy@hust.edu.cn)
****Following documentation comes from original libpmemobj-cpp****
C++ bindings for libpmemobj (https://github.com/pmem/pmdk) More information in include/libpmemobj++/README.md
- cmake >= 3.3
- libpmemobj-dev(el) >= 1.4 (http://pmem.io/pmdk/)
- compiler with C++11 support
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install
$ ...
$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DDEVELOPER_MODE=1
$ ...
$ ctest --output-on-failure
...
cmake .. -DCPACK_GENERATOR="$GEN" -DCMAKE_INSTALL_PREFIX=/usr
make package
$GEN is type of package generator and can be RPM or DEB
CMAKE_INSTALL_PREFIX must be set to a destination were packages will be installed
By default concurrent_hash_map uses pmem::obj::shared_mutex internally. But read-write mutex from Intel(R) Threading Building Blocks library can be used instead to achieve better performance. To enable it in your application set the following compilation flag:
- -DLIBPMEMOBJ_CPP_USE_TBB_RW_MUTEX=1
If you want to build tests for concurrent_hash_map with read-write mutex from Intel(R) Threading Building Blocks library, run cmake with -DUSE_TBB=1 -DTBB_DIR=<Path to Intel TBB>/cmake
option.
Intel(R) Threading Building Blocks library can be downloaded from the official release page.
In order to build your application with libpmemobj-cpp and pmemcheck / memcheck / helgrind / drd, Valgrind instrumentation must be enabled during compilation by adding flags:
- LIBPMEMOBJ_CPP_VG_PMEMCHECK_ENABLED=1 for pmemcheck instrumentation,
- LIBPMEMOBJ_CPP_VG_MEMCHECK_ENABLED=1 for memcheck instrumentation,
- LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED=1 for helgrind instrumentation,
- LIBPMEMOBJ_CPP_VG_DRD_ENABLED=1 for drd instrumentation, or
- LIBPMEMOBJ_CPP_VG_ENABLED=1 for all Valgrind instrumentations (including pmemcheck).
If there are no memcheck / helgrind / drd / pmemcheck headers installed on your system, build will fail.
vcpkg install pmdk:x64-windows
vcpkg integrate install
...
cmake . -Bbuild -G "Visual Studio 14 2015 Win64"
-DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
msbuild build/ALL_BUILD.vcxproj