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
Thread safety -- Fix CastorObjects #890
Conversation
A new Pull Request was created by @apfeiffer1 (Andreas Pfeiffer) for CMSSW_7_0_X. Fix thread safe CastorObjects fix It involves the following packages: CondFormats/CastorObjects @smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please review it and eventually sign? Thanks. |
+1 |
} | ||
// public swap function | ||
void CastorElectronicsMap::swap(CastorElectronicsMap& other) { | ||
std::swap(mPItems, other.mPItems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this with @apfeiffer1 yesterday. Are you sure the two vectors are not related? How do you guarantee that both updates happen atomically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are following the C++11 standard's concept of thead safety which is it is safe to have multiple threads call membe function of an object only if all those functions are const. Swap is not const and therefore we are not expecting it to be safe to call concurrently.
Thread safety -- Fix CastorObjects
This PR is replacing #847 and includes Valentin's latest update (added initialisations).
The new version builds correctly and I successfully ran workflows 4.22, 8.0, and 1306.0 (the others are still running) in CMSSW_7_0_X_2013-09-19-1400 on slc6.
David, could you please schedule a Jenkins for this ?