83
Grouping Operations
With the exception of modifying a single scalar value that fits within the processor’s
word, a series of data modifications must be grouped together and accompanied by a
means of detecting an interruption before completion.
Memory Pools
Memory-mapped files are at the core of the persistent memory programming model.
The libpmemobj library provides a convenient API to easily manage pool creation and
access, avoiding the complexity of directly mapping and synchronizing data. PMDK
also provides a pmempool utility to administer memory pools from the command line.
Memory pools reside on DAX-mounted file systems.
Creating Memory Pools
Use the pmempool utility to create persistent memory pools for use with applications.
Several pool types can be created including pmemblk, pmemlog, and pmemobj. When using
libpmemobj in applications, you want to create a pool of type obj (pmemobj). Refer
to the pmempool-create(1) man page for all available commands and options. The
following examples are for reference:
Example 1. Create a libpmemobj (obj) type pool of minimum allowed size and
layout called “my_layout” in the mounted file system /mnt/pmemfs0/
$ pmempool create --layout my_layout obj /mnt/pmemfs0/pool.obj
Example 2. Create a libpmemobj (obj) pool of 20GiB and layout called “my_
layout” in the mounted file system /mnt/pmemfs0/
$ pmempool create --layout my_layout –-size 20G obj \
/mnt/pmemfs0/pool.obj
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
Grouping Operations
With the exception of modifying a single scalar value that fits within the processor’s
word, a series of data modifications must be grouped together and accompanied by a
means of detecting an interruption before completion.
Memory Pools
Memory-mapped files are at the core of the persistent memory programming model.
The libpmemobj library provides a convenient API to easily manage pool creation and
access, avoiding the complexity of directly mapping and synchronizing data. PMDK
also provides a pmempool utility to administer memory pools from the command line.
Memory pools reside on DAX-mounted file systems.
Creating Memory Pools
Use the pmempool utility to create persistent memory pools for use with applications.
Several pool types can be created including pmemblk, pmemlog, and pmemobj. When using
libpmemobj in applications, you want to create a pool of type obj (pmemobj). Refer
to the pmempool-create(1) man page for all available commands and options. The
following examples are for reference:
Example 1. Create a libpmemobj (obj) type pool of minimum allowed size and
layout called “my_layout” in the mounted file system /mnt/pmemfs0/
$ pmempool create --layout my_layout obj /mnt/pmemfs0/pool.obj
Example 2. Create a libpmemobj (obj) pool of 20GiB and layout called “my_
layout” in the mounted file system /mnt/pmemfs0/
$ pmempool create --layout my_layout –-size 20G obj \
/mnt/pmemfs0/pool.obj
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
