.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEM2_ASYNC" "3" "2022-08-25" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2022, Intel Corporation .SH NAME .PP \f[B]pmem2_config_set_vdm\f[](), \f[B]pmem2_memcpy_async\f[](), \f[B]pmem2_memmove_async\f[](), \f[B]pmem2_memset_async\f[]() \- asynchronous data movement operations .SH SYNOPSIS .IP .nf \f[C] #define\ PMEM2_USE_MINIASYNC\ 1 #include\ struct\ pmem2_future; int\ pmem2_config_set_vdm(struct\ pmem2_config\ *cfg,\ struct\ vdm\ *vdm); struct\ pmem2_future\ pmem2_memcpy_async(struct\ pmem2_map\ *map, \ \ \ \ void\ *pmemdest,\ const\ void\ *src,\ size_t\ len,\ unsigned\ flags); struct\ pmem2_future\ pmem2_memmove_async(struct\ pmem2_map\ *map,\ void\ *pmemdest,\ const\ void\ *src, \ \ \ \ size_t\ len,\ unsigned\ flags) struct\ pmem2_future\ pmem2_memset_async(struct\ pmem2_map\ *map, \ \ \ \ void\ *pmemstr,\ \ int\ c,\ size_t\ n,\ unsigned\ flags) { \f[] .fi .SH DESCRIPTION .PP To use those functions, you must have \f[I]libminiasync\f[] installed. Those functions use futures and vdm (virtual data mover) concepts from this library. Please check \f[B]miniasync\f[](7) for more details. .PP The struct \f[B]pmem2_future\f[] is a structure describing a task to be done asynchronously taking into account persistence of the operation. It means that by the time the future is complete, all the data is safely written into a persistent domain. .PP The \f[B]pmem2_config_set_vdm\f[] sets a vdm structure in the \f[I]pmem2_config\f[]. This structure will be used by pmem2_*_async functions, to create a \f[I]pmem2_future\f[]. If vdm is not set in the config, pmem2_map_new will use a default one which uses a pmem2 memory movement functions to perform memory operations. (\f[B]pmem2_get_memcpy_fn\f[](3), \f[B]pmem2_get_memmove_fn\f[](3), \f[B]pmem2_get_memset_fn\f[](3)). .PP The \f[B]pmem2_memcpy_async\f[] uses \f[I]vdm\f[] structure held inside the \f[I]pmem2_map\f[] structure to initialise and returns \f[B]pmem2_future\f[]. This future will perform memcpy operation defined in \f[I]vdm\f[] to copy \f[I]len\f[] bytes from \f[I]src\f[] to \f[I]pmemdest\f[]. In the current implementation \f[I]flags\f[] are ignored. .PP The \f[B]pmem2_memmove_async\f[] returns \f[B]pmem2_future\f[] which will perform memmove operation defined in \f[I]vdm\f[] to copy \f[I]len\f[] bytes from \f[I]src\f[] to \f[I]pmemdest\f[]. In the current implementation \f[I]flags\f[] are ignored. .PP The \f[B]pmem2_memset_async\f[] returns \f[B]pmem2_future\f[] which will perform memset operation defined in \f[I]vdm\f[] to fill \f[I]n\f[] bytes from \f[I]pmemstr\f[] with value of int \f[I]c\f[] interpreted as unsigned char. In the current implementation \f[I]flags\f[] are ignored. .SH RETURN VALUE .PP The \f[B]pmem2_config_set_vdm\f[] always return 0. .PP The \f[B]pmem2_memcpy_async\f[] returns a new instance of \f[B]pmem2_future\f[] performing memcpy operation. You can execute returned structure using methods from the \f[B]libminiasync\f[]() library such as \f[B]FUTURE_BUSY_POLL\f[](3). .PP The \f[B]pmem2_memmove_async\f[] returns a new instance of \f[B]pmem2_future\f[] performing memmove operation. .PP The \f[B]pmem2_memset_async\f[] returns a new instance of \f[B]pmem2_future\f[] performing memset operation. .SH SEE ALSO .PP \f[B]memcpy\f[](3), \f[B]memmove\f[](3), \f[B]memset\f[](3), \f[B]pmem2_get_drain_fn\f[](3), \f[B]pmem2_get_memcpy_fn\f[](3), \f[B]pmem2_get_memset_fn\f[](3), \f[B]pmem2_map_new\f[](3), \f[B]pmem2_get_persist_fn\f[](3), \f[B]vdm_memcpy\f[](3), \f[B]miniasync\f[](7), \f[B]miniasync_future\f[](7), \f[B]libpmem2\f[](7) and \f[B]\f[]