-
Notifications
You must be signed in to change notification settings - Fork 938
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
[planning_interface] Release Python GIL for C++ calls #1947
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1947 +/- ##
==========================================
+ Coverage 49.82% 49.82% +<.01%
==========================================
Files 313 314 +1
Lines 24714 24717 +3
==========================================
+ Hits 12313 12316 +3
Misses 12401 12401
Continue to review full report at Codecov.
|
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.
Thanks for this contribution. I'm not sure, though we should release and reacquire the GIL for each and every C++ function call. Saving and restoring the thread state comes with its own costs and should be balanced versus the cost of the function call.
53ea5b9
to
5d895b6
Compare
Good point, I reduced the usage of the GILReleaser to the following functions:
|
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.
Looks good to me.
This also makes it straightforward to add more places if it should become relevant.
Annoying nitpick on the license header.
/********************************************************************* | ||
* Software License Agreement (BSD License) | ||
* | ||
* Copyright (c) 2020, Willow Garage, Inc. |
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.
please add your name/ organization.
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.
Done
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* * Neither the name of Willow Garage nor the names of its |
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.
see above.
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.
Apart from Michael's nitpick this looks good to me.
Description
Fixes #1580. (C)Python has a Global Interpreter Lock (GIL) which should be released when doing long-lasting C++ calls.
Checklist