50
operations are required, and because the full file is mapped into the application’s
memory, it can manipulate large collections of data objects with higher and more
consistent performance as compared to files on I/O-accessed storage.
Listing 3-7 shows a C source code example that uses DAX to write a string directly
into persistent memory. This example uses one of the persistent memory API libraries
included in Linux and Windows called libpmem. Although we discuss these libraries in
depth in later chapters, we describe the use of two of the functions available in libpmem
in the following steps. The APIs in libpmem are common across Linux and Windows and
abstract the differences between underlying operating system APIs, so this sample code
is portable across both operating system platforms.
Figure 3-5. Direct access (DAX) I/O and standard file API I/O paths through the
kernel
Chapter 3 Operating SyStem SuppOrt fOr perSiStent memOry
operations are required, and because the full file is mapped into the application’s
memory, it can manipulate large collections of data objects with higher and more
consistent performance as compared to files on I/O-accessed storage.
Listing 3-7 shows a C source code example that uses DAX to write a string directly
into persistent memory. This example uses one of the persistent memory API libraries
included in Linux and Windows called libpmem. Although we discuss these libraries in
depth in later chapters, we describe the use of two of the functions available in libpmem
in the following steps. The APIs in libpmem are common across Linux and Windows and
abstract the differences between underlying operating system APIs, so this sample code
is portable across both operating system platforms.
Figure 3-5. Direct access (DAX) I/O and standard file API I/O paths through the
kernel
Chapter 3 Operating SyStem SuppOrt fOr perSiStent memOry
