-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Rationale
Today we have two IPC caches in UMF:
- For the "producer" flow when an IPC handle is created by calling the
umfGetIPCHandlefunction and released by calling theumfPutIPCHandlefunction. - For the "consumer" flow when an IPC handle is opened (usually by another process) by calling the
umfOpenIPCHandleand closed by calling theumfCloseIPCHandlefunction.
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.