According to https://github.com/NVIDIA/TensorRT/blob/release/7.0/include/NvInferRuntimeCommon.h
//! \brief Single registration point for all plugins in an application. It is
//! used to find plugin implementations during engine deserialization.
//! Internally, the plugin registry is considered to be a singleton so all
//! plugins in an application are part of the same global registry.
//! Note that the plugin registry is only supported for plugins of type
//! IPluginV2 and should also have a corresponding IPluginCreator implementation.
It appears that there is a global, mutable IPluginRegistry (clients cannot create their own for some reason), and this does not give great confidence for thread-safety.
Is the IPluginRegistry returned by getPluginRegistry truly global or is it perhaps thread-local? If it is truly global, since it exposes mutable methods and gives access to all registered creators mutably, how can clients ensure it is used safely in multithreaded applications? Which API functions touch the creator list (since it is global, we clients have no idea) of the registry?
Regards,
Tom Peters
PS I had commented on the IPluginRegistry in another thread: https://devtalk.nvidia.com/default/topic/1064980/tensorrt/opposite-of-registercreator-/post/5408624/#5408624 where I again made the point that having a single global registry is arguably a poor design choice.