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 when calling .read() on a ResampledReadableAudioFile. #283

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

psobot
Copy link
Member

@psobot psobot commented Dec 14, 2023

Prior to this PR, calling .read() on a ResampledReadableAudioFile would not release Python's GIL when doing its (potentially very expensive) resampling calculations. This PR releases the GIL as much as possible to allow multiple threads to resample audio simultaneously. (The GIL could be released even further by refactoring the ReadableAudioFile interface to avoid copies through the py::array_t type; but that's not quite in scope for this PR.)

@psobot psobot added the bug Something isn't working label Dec 14, 2023
@psobot psobot requested a review from gilles December 14, 2023 19:41
@psobot
Copy link
Member Author

psobot commented Dec 14, 2023

🍐 with @gilles.

@psobot psobot merged commit 82e9d0e into master Dec 14, 2023
27 checks passed
@psobot psobot deleted the psobot/release-gil-during-resampling branch December 14, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant