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 safe changes for Geometry CommonDetUnit #1322

Merged
merged 4 commits into from Nov 10, 2013
Merged

Thread safe changes for Geometry CommonDetUnit #1322

merged 4 commits into from Nov 10, 2013

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Nov 4, 2013

No description provided.

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 4, 2013

@Dr15Jones please review

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 4, 2013

A new Pull Request was created by @vkuznet (Valentin Kuznetsov) for CMSSW_7_0_X.

Thread safe changes for Geometry CommonDetUnit

It involves the following packages:

Geometry/CommonDetUnit

@civanch, @Dr15Jones, @ianna, @mdhildreth, @nclopezo, @ktf can you please review it and eventually sign? Thanks.
@ghellwig this is something you requested to watch as well.
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.

}
return theDetTypes;
if (!theDetTypes.load(std::memory_order_acquire)) {
auto ptr = new DetTypeContainer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to always use a std::unique_ptr<> to manage the memory.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2013

Pull request #1322 was updated. @civanch, @Dr15Jones, @ianna, @mdhildreth, @cmsbuild, @nclopezo, @ktf can you please check and sign again.

}
DetTypeContainer* expect = nullptr;
bool exchanged = theDetTypes.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel);
if(!exchanged) ptr.reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will always delete the object held by the auto_ptr<>. The necessary pattern is

if(theDetTypes.compare_exchange_strong(...) ) {
   //releases ownership
   ptr.release();
}

@Dr15Jones
Copy link
Contributor

-1

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 5, 2013

Pull request #1322 was updated. @civanch, @Dr15Jones, @ianna, @mdhildreth, @cmsbuild, @nclopezo, @ktf can you please check and sign again.

@Dr15Jones
Copy link
Contributor

Looks good to me

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2013

-1
I ran the usual tests and I found errors in the following unit tests:

---> test runtestPhysicsToolsPatAlgos had ERRORS

you can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/1197/summary.html

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2013

Pull request #1322 was updated. @civanch, @Dr15Jones, @ianna, @mdhildreth, @cmsbuild, @nclopezo, @ktf can you please check and sign again.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2013

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2013

@ianna
Copy link
Contributor

ianna commented Nov 8, 2013

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 8, 2013

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

ktf added a commit that referenced this pull request Nov 10, 2013
Multithreading fixes -- Thread safe changes for Geometry CommonDetUnit
@ktf ktf merged commit 25b06d8 into cms-sw:CMSSW_7_0_X Nov 10, 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