PMDK C++ bindings  1.13.0-git23.gf49772ac
This is the C++ bindings documentation for PMDK's libpmemobj.
Public Member Functions | List of all members
pmem::obj::experimental::concurrent_map< Key, Value, Comp, Allocator > Class Template Reference

Persistent memory aware implementation of Intel TBB concurrent_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_mapoperator= (const concurrent_map &other)
 Assignment operator.
 
concurrent_mapoperator= (concurrent_map &&other)
 Move-assignment operator.
 

Detailed Description

template<typename Key, typename Value, typename Comp = std::less<Key>, typename Allocator = pmem::obj::allocator<detail::pair<const Key, Value>>>
class pmem::obj::experimental::concurrent_map< Key, Value, Comp, Allocator >

Persistent memory aware implementation of Intel TBB concurrent_map.

It is 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 Allcoator types should be persistent memory aware types. Allocator type should satisfies the named requirements (https://en.cppreference.com/w/cpp/named_req/Allocator). The allocate() and deallocate() methods are called inside transactions.


The documentation for this class was generated from the following file: