1() PMDK Programmer's Manual ()
2
3
4
6 pmem2_config_set_vdm()(DEPRECATED), pmem2_memcpy_async()(DEPRECATED),
7 pmem2_memmove_async()(DEPRECATED), pmem2_memset_async()(DEPRECATED) -
8 asynchronous data movement operations
9
10 NOTICE: Support for async functions is deprecated since PMDK
11 1.13.0 release and will be removed in the PMDK 1.14.0 release
12 along with the miniasync dependency.
13
15 #define PMEM2_USE_MINIASYNC 1
16 #include <libpmem2.h>
17 struct pmem2_future;
18
19 int pmem2_config_set_vdm(struct pmem2_config *cfg, struct vdm *vdm);
20
21 struct pmem2_future pmem2_memcpy_async(struct pmem2_map *map,
22 void *pmemdest, const void *src, size_t len, unsigned flags);
23
24 struct pmem2_future pmem2_memmove_async(struct pmem2_map *map, void *pmemdest, const void *src,
25 size_t len, unsigned flags)
26
27 struct pmem2_future pmem2_memset_async(struct pmem2_map *map,
28 void *pmemstr, int c, size_t n, unsigned flags)
29 {
30
32 To use those functions, you must have libminiasync installed. Those
33 functions use futures and vdm (virtual data mover) concepts from this
34 library. Please check miniasync(7) for more details.
35
36 The struct pmem2_future is a structure describing a task to be done
37 asynchronously taking into account persistence of the operation. It
38 means that by the time the future is complete, all the data is safely
39 written into a persistent domain.
40
41 The pmem2_config_set_vdm sets a vdm structure in the pmem2_config.
42 This structure will be used by pmem2_*_async functions, to create a
43 pmem2_future. If vdm is not set in the config, pmem2_map_new will use
44 a default one which uses a pmem2 memory movement functions to perform
45 memory operations. (pmem2_get_memcpy_fn(3), pmem2_get_memmove_fn(3),
46 pmem2_get_memset_fn(3)).
47
48 The pmem2_memcpy_async uses vdm structure held inside the pmem2_map
49 structure to initialise and returns pmem2_future. This future will
50 perform memcpy operation defined in vdm to copy len bytes from src to
51 pmemdest. In the current implementation flags are ignored.
52
53 The pmem2_memmove_async returns pmem2_future which will perform memmove
54 operation defined in vdm to copy len bytes from src to pmemdest. In
55 the current implementation flags are ignored.
56
57 The pmem2_memset_async returns pmem2_future which will perform memset
58 operation defined in vdm to fill n bytes from pmemstr with value of int
59 c interpreted as unsigned char. In the current implementation flags
60 are ignored.
61
63 The pmem2_config_set_vdm always return 0.
64
65 The pmem2_memcpy_async returns a new instance of pmem2_future perform‐
66 ing memcpy operation. You can execute returned structure using methods
67 from the libminiasync() library such as FUTURE_BUSY_POLL(3).
68
69 The pmem2_memmove_async returns a new instance of pmem2_future perform‐
70 ing memmove operation.
71
72 The pmem2_memset_async returns a new instance of pmem2_future perform‐
73 ing memset operation.
74
76 memcpy(3), memmove(3), memset(3), pmem2_get_drain_fn(3), pmem2_get_mem‐
77 cpy_fn(3), pmem2_get_memset_fn(3), pmem2_map_new(3), pmem2_get_per‐
78 sist_fn(3), vdm_memcpy(3), miniasync(7), miniasync_future(7), libp‐
79 mem2(7) and <https://pmem.io>
80
81
82
83PMDK - 2023-06-05 ()