eric-haibin-lin opened a new issue #17495: Initial inspections for singleton thread safety in MXNet URL: https://github.com/apache/incubator-mxnet/issues/17495 I roughly skim-through the code base and searched for classes with `::Get` method. Some of these class objects are global singletons and have potential thread safety issues. I list the initial assessment: ### thread safe classes These classes are thread safe - ::dmlc::Registry<TVMOpConfig> - Engine - Storage - StorageManager - CPUSharedStorageManager - GPUPooledStorageManager - GPUPooledRoundedStorageManager - PinnedMemoryStorage - GPUDeviceStorage/NaiveStorageManager - CPUDeviceStorage - Profiler - CustomOpProfiler - LazyAllocArray ### is a thread_local object or contains thread local variables The thread safety depends on the lifecycle of the thread. Are there alternative ways to avoid them? - ResourceManager - MKLDNNStream @PatricZhao @TaoLv - Imperative ### classes that are not thread safe These classes are not thread safe and may cause bugs: - engine::OpenMP - DeviceStorageProfiler - SubgraphBackendRegistry @samskalicky I didn't look into C APIs. And there are lots of other thread_local objects spreading around in the code base as well.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services