9
• The libpmemobj library is a full-featured transaction and allocation
library for persistent memory. (Chapters 7 and 8 describe libpmemobj
and its C++ cousin in more detail.) If you cannot find data structures
that meet your needs, you will most likely have to implement what
you need using this library, as described in Chapter 11.
• The cmap engine, a concurrent hash map optimized for persistent
memory.
• The libpmemkv library, providing the API demonstrated in Listing 1-1.
• And finally, the application that uses the API provided by libpmemkv.
Although there is quite a stack of components in use here, it does not mean there
is necessarily a large amount of code that runs for each operation. Some components
are only used during the initial setup. For example, the pmem-aware file system is
used to find the persistent memory file and perform permission checks; it is out of the
application’s data path after that. The PMDK libraries are designed to leverage the direct
access allowed by persistent memory as much as possible.
What’s Next?
Chapters 1 through 3 provide the essential background that programmers need to know to
start persistent memory programming. The stage is now set with a simple example; the next
two chapters provide details about persistent memory at the hardware and operating system
levels. The later and more advanced chapters provide much more detail for those interested.
Because the immediate goal is to get you programming quickly, we recommend
reading Chapters 2 and 3 to gain the essential background and then dive into Chapter 4
where we start to show more detailed persistent memory programming examples.
Summary
This chapter shows how high-level APIs like libpmemkv can be used for persistent
memory programming, hiding complex details of persistent memory from the
application developer. Using persistent memory can allow finer-grained access and
higher performance than block-based storage. We recommend using the highest-level,
simplest APIs possible and only introducing the complexity of lower-level persistent
memory programming as necessary.
CHApter 1 IntroduCtIon to persIstent MeMory proGrAMMInG
Précédent

- 38/457

Suivant