Rationale
Today we have two IPC caches in UMF:
- For the "producer" flow when an IPC handle is created by calling the
umfGetIPCHandle function and released by calling the umfPutIPCHandle function.
- For the "consumer" flow when an IPC handle is opened (usually by another process) by calling the
umfOpenIPCHandle and closed by calling the umfCloseIPCHandle function.
This issue is related to the "producer" flow. Today it uses just the critnib map to cache created IPC handles from memory provider. BUt we need to support the threshold for the cache size as we do for the opened IPC handles cache in #998.
Description
Introduce the UMF_MAX_CREATED_IPC_HANDLES environment variable (the name is subject to discussion) to limit the cache size. As for the consumer flow use true cache implementation (hash amp + LRU list) instead of just a map.
API Changes
No API changes. Only a new environment variable to control the maximum cache size
Implementation details
See the ipc_cache.h and the ipc_cache.c for how IPC cache is implemented for the "consumer" flow. We need almost the same for the "producer" flow. Only the cache key and value structures will be different.
Meta
Rationale
Today we have two IPC caches in UMF:
umfGetIPCHandlefunction and released by calling theumfPutIPCHandlefunction.umfOpenIPCHandleand closed by calling theumfCloseIPCHandlefunction.This issue is related to the "producer" flow. Today it uses just the
critnibmap to cache created IPC handles from memory provider. BUt we need to support the threshold for the cache size as we do for the opened IPC handles cache in #998.Description
Introduce the
UMF_MAX_CREATED_IPC_HANDLESenvironment variable (the name is subject to discussion) to limit the cache size. As for the consumer flow use true cache implementation (hash amp + LRU list) instead of just a map.API Changes
No API changes. Only a new environment variable to control the maximum cache size
Implementation details
See the
ipc_cache.hand theipc_cache.cfor how IPC cache is implemented for the "consumer" flow. We need almost the same for the "producer" flow. Only the cache key and value structures will be different.Meta