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

Make Python bindings thread-friendly #2442

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jbaayen
Copy link

@jbaayen jbaayen commented May 23, 2019

  • Disable "pythonlogger" as it locks the GIL. This would cause the GIL
    to be locked for every line of console output from, e.g., IPOPT.
  • Wrap DM function calls in Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS
    so that the GIL is released during numeric CasADi function calls.

- Disable "pythonlogger" as it locks the GIL.  This would cause the GIL
  to be locked for every line of console output from, e.g., IPOPT.
- Wrap DM function calls in Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS
  so that the GIL is released during numeric CasADi function calls.
@jbaayen
Copy link
Author

jbaayen commented May 23, 2019

@jgillis FYI

@jbaayen
Copy link
Author

jbaayen commented May 24, 2019

I understand DM function calls are not thread safe, but that the new Python calling API in #2433 would be. The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS would then have to move there.

jgillis added a commit that referenced this pull request Jun 24, 2021
jgillis added a commit that referenced this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant