283
For C developers, the libpmemobj library provides pthread-like synchronization
primitives shown in Table 14-2. Persistent memory-aware locking implementations are
based on the standard POSIX Thread Library and provide semantics similar to standard
pthread locks.
Table 14-1. Synchronization primitives provided by libpmemob++ library
Class
Description
pmem::obj::mutex
this class is an implementation of a persistent memory resident
mutex which mimics in behavior the C++11 std::mutex. this class
satisfies all requirements of the Mutex and standardLayouttype
concepts.
pmem::obj::timed_mutex
this class is an implementation of a persistent memory resident
timed_mutex which mimics in behavior the C++11 std::timed_
mutex. this class satisfies all requirements of timedMutex and
standardLayouttype concepts.
pmem::obj::shared_mutex
this class is an implementation of a persistent memory resident
shared_mutex which mimics in behavior the C++17 std::shared_
mutex. this class satisfies all requirements of sharedMutex and
standardLayouttype concepts.
pmem::obj:: condition_variable this class is an implementation of a persistent memory resident
condition variable which mimics in behavior the C++11
std::condition_variable. this class satisfies all requirements of
standardLayouttype concept.
Table 14-2. Synchronization primitives provided by the libpmemobj library
Structure
Description
pMeMmutex
the data structure represents a persistent memory resident mutex similar
to pthread_mutex_t.
pMeMrwlock
the data structure represents a persistent memory resident read-write lock
similar to pthread_rwlock_t.
pMeMcond
the data structure represents a persistent memory resident condition
variable similar to pthread_cond_t.
Chapter 14 ConCurrenCy and persistent MeMory
For C developers, the libpmemobj library provides pthread-like synchronization
primitives shown in Table 14-2. Persistent memory-aware locking implementations are
based on the standard POSIX Thread Library and provide semantics similar to standard
pthread locks.
Table 14-1. Synchronization primitives provided by libpmemob++ library
Class
Description
pmem::obj::mutex
this class is an implementation of a persistent memory resident
mutex which mimics in behavior the C++11 std::mutex. this class
satisfies all requirements of the Mutex and standardLayouttype
concepts.
pmem::obj::timed_mutex
this class is an implementation of a persistent memory resident
timed_mutex which mimics in behavior the C++11 std::timed_
mutex. this class satisfies all requirements of timedMutex and
standardLayouttype concepts.
pmem::obj::shared_mutex
this class is an implementation of a persistent memory resident
shared_mutex which mimics in behavior the C++17 std::shared_
mutex. this class satisfies all requirements of sharedMutex and
standardLayouttype concepts.
pmem::obj:: condition_variable this class is an implementation of a persistent memory resident
condition variable which mimics in behavior the C++11
std::condition_variable. this class satisfies all requirements of
standardLayouttype concept.
Table 14-2. Synchronization primitives provided by the libpmemobj library
Structure
Description
pMeMmutex
the data structure represents a persistent memory resident mutex similar
to pthread_mutex_t.
pMeMrwlock
the data structure represents a persistent memory resident read-write lock
similar to pthread_rwlock_t.
pMeMcond
the data structure represents a persistent memory resident condition
variable similar to pthread_cond_t.
Chapter 14 ConCurrenCy and persistent MeMory
