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 Python GIL when possible #111

Open
grantjenks opened this issue May 23, 2022 · 2 comments
Open

Release Python GIL when possible #111

grantjenks opened this issue May 23, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@grantjenks
Copy link

I'm looking to search several million source files using the tree-sitter query interface. I'd love to use a thread pool in Python for this. Would it be possible to make a thread-safe Query.captures method that released the GIL?

I tried doing it in https://github.com/grantjenks/py-tree-sitter-languages but couldn't figure it out this evening (not sure it's possible with the current interface).

@ObserverOfTime
Copy link
Member

PR welcome.

@ObserverOfTime ObserverOfTime added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Feb 26, 2024
@ansipunk
Copy link

This might be slightly easier to implement with recent changes to GIL in 3.12:
https://docs.python.org/3.12/whatsnew/3.12.html#pep-684-a-per-interpreter-gil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants