New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to std::mutex in ThreadSafeRegistry #4765
Switch to std::mutex in ThreadSafeRegistry #4765
Conversation
The ThreadLocalRegistry was previously using a boost::mutex but we now prefer std::mutex. In addition, since all templated instances of ThreadLocalRegistry use the same global mutex, the storage for that mutex was moved to its own .cc file rather than having each use of the .icc file create new storage.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_2_X. Switch to std::mutex in ThreadSafeRegistry It involves the following packages: DataFormats/FWLite @cmsbuild, @Degano, @Dr15Jones, @ktf, @nclopezo can you please review it and eventually sign? Thanks. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes or unless it breaks tests. |
-1 >> Compiling /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/HLTrigger/HLTcore/src/HLTConfigData.cc >> Compiling /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/HLTrigger/HLTcore/src/HLTConfigDataRegistry.cc >> Compiling /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/HLTrigger/HLTcore/src/HLTConfigProvider.cc In file included from /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/HLTrigger/HLTcore/interface/HLTConfigDataRegistry.h:7:0, from /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/HLTrigger/HLTcore/src/HLTConfigDataRegistry.cc:2: /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc:9:51: error: conflicting specifiers in declaration of 'registry_mutex' [[edm::thread_safe]] extern static std::mutex registry_mutex; ^ /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc: In member function 'bool edm::detail::ThreadSafeRegistry::getMapped(const key_type&, edm::detail::ThreadSafeRegistry::value_type&) const': /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-23-0200/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc:27:25: error: missing template arguments before 'lock' std::lock_guard lock(registry_mutex); you can see the results of the tests here: |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes (but tests are reportedly failing). |
-1 >> Compiling /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/HLTrigger/HLTcore/src/HLTConfigDataRegistry.cc Leaving library rule at Geometry/CommonTopologies >> Compiling /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/HLTrigger/HLTcore/src/HLTConfigProvider.cc In file included from /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/HLTrigger/HLTcore/interface/HLTConfigDataRegistry.h:7:0, from /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/HLTrigger/HLTcore/src/HLTConfigDataRegistry.cc:2: /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc:9:51: error: conflicting specifiers in declaration of 'registry_mutex' [[edm::thread_safe]] extern static std::mutex registry_mutex; ^ /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc: In member function 'bool edm::detail::ThreadSafeRegistry::getMapped(const key_type&, edm::detail::ThreadSafeRegistry::value_type&) const': /build/cmsbuild/jenkins-workarea/workspace/ib-integration-CMSSW_7_2_X-slc6_amd64_gcc481/CMSSW_7_2_X_2014-07-22-1400/src/FWCore/Utilities/interface/ThreadSafeRegistry.icc:27:25: error: missing template arguments before 'lock' std::lock_guard lock(registry_mutex); you can see the results of the tests here: |
-Removed all the interfaces which provided direct internal access to the container and therefore were not thread-safe -Protected all remaining interfaces with the mutex -Made the mutex a member variable to avoid creating one each time the .icc file is included.
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes (tests are also fine). |
…egistry Switch to std::mutex in ThreadSafeRegistry
edm::ThreadSafeRegistry was formerly using boost::mutex but we prefer std::mutex.
Moved the shared global std::mutex so its storage is declared in FWCore/Utilities instead of in all files which were including ThreadSafeRegistry.icc.
Removed unnecessary includes of ThreadSafeRegistry.h from the framework internals.