81
© The Author(s) 2020
S. Scargall, Programming Persistent Memory, https://doi.org/10.1007/978-1-4842-4932-1_7
CHAPTER 7
libpmemobj: A Native
Transactional Object Store
In the previous chapter, we described libpmem, the low-level persistent memory library
that provides you with an easy way to directly access persistent memory. libpmem is a
small, lightweight, and feature-limited library that is designed for software that tracks
every store to pmem and needs to flush those changes to persistence. It excels at what
it does. However, most developers will find higher-level libraries within the Persistent
Memory Development Kit (PMDK), like libpmemobj, to be much more convenient.
This chapter describes libpmemobj, which builds upon libpmem and turns persistent
memory-mapped files into a flexible object store. It supports transactions, memory
management, locking, lists, and several other features.
What is libpmemobj?
The libpmemobj library provides a transactional object store in persistent memory for
applications that require transactions and persistent memory management using direct
access (DAX) to the memory. Briefly recapping our DAX discussion in Chapter 3, DAX
allows applications to memory map files on a persistent memory-aware file system to
provide direct load/store operations without paging blocks from a block storage device.
It bypasses the kernel, avoids context switches and interrupts, and allows applications to
read and write directly to the byte-addressable persistent storage.
© The Author(s) 2020
S. Scargall, Programming Persistent Memory, https://doi.org/10.1007/978-1-4842-4932-1_7
CHAPTER 7
libpmemobj: A Native
Transactional Object Store
In the previous chapter, we described libpmem, the low-level persistent memory library
that provides you with an easy way to directly access persistent memory. libpmem is a
small, lightweight, and feature-limited library that is designed for software that tracks
every store to pmem and needs to flush those changes to persistence. It excels at what
it does. However, most developers will find higher-level libraries within the Persistent
Memory Development Kit (PMDK), like libpmemobj, to be much more convenient.
This chapter describes libpmemobj, which builds upon libpmem and turns persistent
memory-mapped files into a flexible object store. It supports transactions, memory
management, locking, lists, and several other features.
What is libpmemobj?
The libpmemobj library provides a transactional object store in persistent memory for
applications that require transactions and persistent memory management using direct
access (DAX) to the memory. Briefly recapping our DAX discussion in Chapter 3, DAX
allows applications to memory map files on a persistent memory-aware file system to
provide direct load/store operations without paging blocks from a block storage device.
It bypasses the kernel, avoids context switches and interrupts, and allows applications to
read and write directly to the byte-addressable persistent storage.
