File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,26 @@ IPC API allows retrieving IPC handles for the memory buffers allocated from
168
168
UMF memory pools. The memory provider used by the pool should support IPC
169
169
operations for this API to work. Otherwise IPC APIs return an error.
170
170
171
+ IPC caching
172
+ ------------------------------------------
173
+
174
+ UMF employs IPC caching to avoid multiple IPC handles being created for the same
175
+ coarse-grain memory region allocated by the memory provider. UMF guarantees that
176
+ for each coarse-grain memory region allocated by the memory provider, only one
177
+ IPC handle is created when the :any: `umfGetIPCHandle ` function is called. All
178
+ subsequent calls to the :any: `umfGetIPCHandle ` function for the pointer to the
179
+ same memory region will return the entry from the cache.
180
+
181
+ The same is true for the :any: `umfOpenIPCHandle ` function. The actual mapping
182
+ of the IPC handle to the virtual address space is created only once, and all
183
+ subsequent calls to open the same IPC handle will return the entry from the cache.
184
+ The size of the cache for opened IPC handles is controlled by the ``UMF_MAX_OPENED_IPC_HANDLES ``
185
+ environment variable. By default, the cache size is unlimited. However, if the environment
186
+ variable is set and the cache size exceeds the limit, old items will be evicted. UMF tracks
187
+ the ref count for each entry in the cache and can evict only items with the ref count equal to 0.
188
+ The ref count is increased when the :any: `umfOpenIPCHandle ` function is called and decreased
189
+ when the :any: `umfCloseIPCHandle ` function is called for the corresponding IPC handle.
190
+
171
191
.. _ipc-api :
172
192
173
193
IPC API
You can’t perform that action at this time.
0 commit comments