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

Manually manage the GIL with Cython #497

Open
Tracked by #514
alxmrs opened this issue Jul 14, 2024 · 3 comments
Open
Tracked by #514

Manually manage the GIL with Cython #497

alxmrs opened this issue Jul 14, 2024 · 3 comments

Comments

@alxmrs
Copy link
Contributor

alxmrs commented Jul 14, 2024

I suspect that the performance of the ThreadPoolExecutor would substantially increase if we strategically placed cython with nogil calls.

There are drawbacks to process based parallelism; namely, there is a high overhead and IPC latency compared to multithreading.

@alxmrs
Copy link
Contributor Author

alxmrs commented Jul 14, 2024

Memory views for shared memory: https://docs.cython.org/en/latest/src/userguide/memoryviews.html

@tomwhite
Copy link
Member

Another approach is free-threaded Python, which is just ramping up (but is going to take some time):

@alxmrs
Copy link
Contributor Author

alxmrs commented Jul 19, 2024

TIL! I didn’t realize threaded Python was coming so soon! Thanks for the pointers.

The Cython tricks may be useful in the near-term for younger versions of Python.

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

No branches or pull requests

2 participants