diff --git a/templates/examples/F/body.tmpl b/templates/examples/F/body.tmpl index c2cff3a..339ed2a 100644 --- a/templates/examples/F/body.tmpl +++ b/templates/examples/F/body.tmpl @@ -9,7 +9,7 @@ with no allocation or transaction help, there are some application responsibilities you must follow.

This example shows how to use raw access to -persistent memory using C and libpmem. +persistent memory using C and libpmem2. {{template "scrollToContinue"}} @@ -61,22 +61,23 @@ for this is CLWB. Another method is to use Checking all these things at application start-up time is mundane and not worth re-inventing for your application. Even if you don't need any of the other features of PMDK like allocation or transactions, -you will still want libpmem to handle these platform-specific +you will still want libpmem2 to handle these platform-specific details. {{step "Low-Level Programming in C"}}

-A simple C program using libpmem is shown below. Notice the -is_pmem and how it is used to determine if it is safe to -flush from user space. To flush from user space, the function -pmem_persist() -is used. +A simple C program using libpmem2 is shown below. The correct mechanism for flushing the data +into the underlaying medium is automatically chosen by libpmem2. To obtain the correct function for flushing +from user space, pmem2_get_persist_fn() +is used. It returns a pointer to the function, which efficiently persists the data in the range owned by the map. As can be seen in the example below, +we call this function with the provided map argument after our data was stored to the persistent memory (see line 100). The obtained function +is then used to flush our data into persistence as it guarantees the data is stored durably by the time it returns.

-libpmem also provides optimal ways to copy data to persistent +libpmem2 also provides optimal ways to copy data to persistent memory and make it persistent. For example, see the call to -pmem_memcpy_persist() on line 61 below. -The libpmem man page +pmem2_get_memcpy_fn() on line 108 below. +The libpmem2 man page provides the full list of available functions in the library.

You can edit the program below and make changes if you'd like to @@ -112,7 +113,7 @@ Now you can try running the program using the above commands. {{summary}}

-This example showed how to use libpmem for low-level +This example showed how to use libpmem2 for low-level persistent memory programming. There are no transactions at this level, and the programmer is responsible for keeping track of which ranges of persistent memory are in-use, and which