1PMEM2_ASYNC(3)             PMDK Programmer's Manual             PMEM2_ASYNC(3)
2
3
4

NAME

6       pmem2_config_set_vdm(),   pmem2_memcpy_async(),  pmem2_memmove_async(),
7       pmem2_memset_async() - asynchronous data movement operations
8

SYNOPSIS

10              #define PMEM2_USE_MINIASYNC 1
11              #include <libpmem2.h>
12              struct pmem2_future;
13
14              int pmem2_config_set_vdm(struct pmem2_config *cfg, struct vdm *vdm);
15
16              struct pmem2_future pmem2_memcpy_async(struct pmem2_map *map,
17                  void *pmemdest, const void *src, size_t len, unsigned flags);
18
19              struct pmem2_future pmem2_memmove_async(struct pmem2_map *map, void *pmemdest, const void *src,
20                  size_t len, unsigned flags)
21
22              struct pmem2_future pmem2_memset_async(struct pmem2_map *map,
23                  void *pmemstr,  int c, size_t n, unsigned flags)
24              {
25

DESCRIPTION

27       To use those functions, you must have  libminiasync  installed.   Those
28       functions  use  futures and vdm (virtual data mover) concepts from this
29       library.  Please check miniasync(7) for more details.
30
31       The struct pmem2_future is a structure describing a  task  to  be  done
32       asynchronously  taking  into  account persistence of the operation.  It
33       means that by the time the future is complete, all the data  is  safely
34       written into a persistent domain.
35
36       The  pmem2_config_set_vdm  sets  a  vdm  structure in the pmem2_config.
37       This structure will be used by pmem2_*_async  functions,  to  create  a
38       pmem2_future.   If vdm is not set in the config, pmem2_map_new will use
39       a default one which uses a pmem2 memory movement functions  to  perform
40       memory  operations.   (pmem2_get_memcpy_fn(3), pmem2_get_memmove_fn(3),
41       pmem2_get_memset_fn(3)).
42
43       The pmem2_memcpy_async uses vdm structure  held  inside  the  pmem2_map
44       structure  to  initialise  and  returns pmem2_future.  This future will
45       perform memcpy operation defined in vdm to copy len bytes from  src  to
46       pmemdest.  In the current implementation flags are ignored.
47
48       The pmem2_memmove_async returns pmem2_future which will perform memmove
49       operation defined in vdm to copy len bytes from src  to  pmemdest.   In
50       the current implementation flags are ignored.
51
52       The  pmem2_memset_async  returns pmem2_future which will perform memset
53       operation defined in vdm to fill n bytes from pmemstr with value of int
54       c  interpreted  as  unsigned char.  In the current implementation flags
55       are ignored.
56

RETURN VALUE

58       The pmem2_config_set_vdm always return 0.
59
60       The pmem2_memcpy_async returns a new instance of pmem2_future  perform‐
61       ing memcpy operation.  You can execute returned structure using methods
62       from the libminiasync() library such as FUTURE_BUSY_POLL(3).
63
64       The pmem2_memmove_async returns a new instance of pmem2_future perform‐
65       ing memmove operation.
66
67       The  pmem2_memset_async returns a new instance of pmem2_future perform‐
68       ing memset operation.
69

SEE ALSO

71       memcpy(3), memmove(3), memset(3), pmem2_get_drain_fn(3), pmem2_get_mem‐
72       cpy_fn(3),   pmem2_get_memset_fn(3),  pmem2_map_new(3),  pmem2_get_per‐
73       sist_fn(3),  vdm_memcpy(3),  miniasync(7),  miniasync_future(7),  libp‐
74       mem2(7) and <https://pmem.io>
75
76
77
78PMDK - pmem2 API version 1.0      2022-05-24                    PMEM2_ASYNC(3)
Impressum