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

Release the GIL during decompression #1

Open
brianhelba opened this issue Feb 24, 2021 · 0 comments · May be fixed by #31
Open

Release the GIL during decompression #1

brianhelba opened this issue Feb 24, 2021 · 0 comments · May be fixed by #31

Comments

@brianhelba
Copy link
Owner

brianhelba commented Feb 24, 2021

This requires wrapping code in Py_BEGIN_ALLOW_THREADS: https://docs.python.org/3/c-api/init.html#releasing-the-gil-from-extension-code

As part of this, memory allocation (including the use of Bytes objects) will need to be switched to use exclusively PyMem_RawMalloc, as PyMem_Malloc and PyBytes_* operations (which internally use PyObject_Malloc) are not safe to be used without the GIL: https://docs.python.org/3/c-api/memory.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant