PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Persistent memory aware implementation of Intel TBB concurrent_map with API partially compatible to std::map. More...
#include <libpmemobj++/experimental/concurrent_map.hpp>
Inherits detail::concurrent_skip_list< detail::map_traits< Key, Value, std::less< Key >, detail::default_random_generator, pmem::obj::allocator< detail::pair< const Key, Value >>, false, 64 > >.
Public Member Functions | |
concurrent_map ()=default | |
Default constructor. | |
concurrent_map (const concurrent_map &table) | |
Copy constructor. | |
concurrent_map (concurrent_map &&table) | |
Move constructor. | |
concurrent_map (const key_compare &comp, const allocator_type &alloc=allocator_type()) | |
Construct the empty map. | |
template<class InputIt > | |
concurrent_map (InputIt first, InputIt last, const key_compare &comp=Comp(), const allocator_type &alloc=allocator_type()) | |
Constructs the map with the contents of the range [first, last). | |
concurrent_map (std::initializer_list< value_type > ilist) | |
Constructs the map with initializer list. | |
concurrent_map & | operator= (const concurrent_map &other) |
Assignment operator. | |
concurrent_map & | operator= (concurrent_map &&other) |
Move-assignment operator. | |
concurrent_map & | operator= (std::initializer_list< value_type > ilist) |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Key , typename Value , typename Comp , typename Allocator > | |
void | swap (concurrent_map< Key, Value, Comp, Allocator > &lhs, concurrent_map< Key, Value, Comp, Allocator > &rhs) |
Non-member swap. | |
Persistent memory aware implementation of Intel TBB concurrent_map with API partially compatible to std::map.
A sorted associative container that contains key-value pairs with unique keys. Keys are sorted by using the comparison function Compare. Search, removal, and insertion operations have average logarithmic complexity. Everywhere the concurrent_map uses the Compare requirements, uniqueness is determined by using the equivalence relation. In imprecise terms, two objects a and b are considered equivalent (not unique) if neither compares less than the other: !comp(a, b) && !comp(b, a).
The implementation is based on the lock-based concurrent skip list algorithm described in https://www.cs.tau.ac.il/~shanir/nir-pubs-web/Papers/OPODIS2006-BA.pdf. Our concurrent skip list implementation supports concurrent insertion and traversal, but not concurrent erasure. The erase method is prefixed with unsafe_, to indicate that there is no concurrency safety.
Each time, the pool with concurrent_map is being opened, the concurrent_map requires runtime_initialize() to be called in order to restore the map state after process restart.
Key, Value, Comp and Allocator types should be persistent memory aware types. Allocator type should satisfy the named requirements (https://en.cppreference.com/w/cpp/named_req/Allocator). The allocate() and deallocate() methods are called inside transactions.