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
Made statics in NuclearInteractionFTFSimulator thread safe #9064
Made statics in NuclearInteractionFTFSimulator thread safe #9064
Conversation
The static analyzer identified a thread-safety issue with the static class members of NuclearInteractionFTFSimulator. Using an std::call_once makes sure the array is safely initialized.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_5_X. Made statics in NuclearInteractionFTFSimulator thread safe It involves the following packages: FastSimulation/MaterialEffects @ssekmen, @nclopezo, @lveldere, @civanch, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks. |
please test |
The tests are being triggered in jenkins. |
@Dr15Jones , thank you for the fix. FastSim is not yet MT capable, so this this fix will be useful for future. Concerning Geant4 : all public versions are not yet c++11, however, code is safe, because initialisation of shared data is done in the master thread; if it is not guaranteed that initialisation is done by the master then a mutex lock is set locally in the initialisation method. I would also agree, that in the case of FastSim we need double check that the code used for FastSim is safe itself and not only in Geant4 context. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_5_X IBs unless changes or unless it breaks tests. This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @nclopezo, @smuzaffar |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_5_X IBs unless changes (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @nclopezo, @smuzaffar |
+1 |
…InteractionFTFSimulator Made statics in NuclearInteractionFTFSimulator thread safe
The static analyzer identified a thread-safety issue with the static class members of NuclearInteractionFTFSimulator. Using an std::call_once makes sure the array is safely initialized.
NOTE: Someone should check that the Geant 4 classes used in this code can safely be called on different threads.