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

Free-threaded Python support #19

Open
szalpal opened this issue Apr 24, 2024 · 1 comment
Open

Free-threaded Python support #19

szalpal opened this issue Apr 24, 2024 · 1 comment

Comments

@szalpal
Copy link

szalpal commented Apr 24, 2024

Hi,

Recently PEP 703 has been approved, which removes the GIL in Python. The timeline of the change is far, however I'd like to ask, is there a particular plan of fastrlock working without the GIL?

I'm particularly asking, since from the How does it work section I understand that fastrlock is inherently coupled with GIL.

Ideally fastrlock API might stay unchanged, so that any project using fastrlock does not require code changes.

@scoder
Copy link
Owner

scoder commented Apr 24, 2024

In nogil CPython (which has already landed in CPython 3.13), you can probably just use threading.RLock instead – unless you're asking about fastrlock's C-API.

The change that CPython needed seems to be this:
python/cpython@f366e21
It uses atomics, which seems reasonable.

The same can probably be implemented for fastrlock. PR welcome.

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