Skip to content
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

Merged
merged 3 commits into from Sep 23, 2013

Conversation

apfeiffer1
Copy link
Contributor

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 ?

@cmsbuild
Copy link
Contributor

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.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@apfeiffer1
Copy link
Contributor Author

+1
provided Jenkins agrees. :)

}
// public swap function
void CastorElectronicsMap::swap(CastorElectronicsMap& other) {
std::swap(mPItems, other.mPItems);
Copy link
Contributor

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?

Copy link
Contributor

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.

ktf added a commit that referenced this pull request Sep 23, 2013
@ktf ktf merged commit afcefce into cms-sw:CMSSW_7_0_X Sep 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants