Skip to content

PEP 703 Deferred reference counts #121459

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

Closed
Fidget-Spinner opened this issue Jul 7, 2024 · 3 comments
Closed

PEP 703 Deferred reference counts #121459

Fidget-Spinner opened this issue Jul 7, 2024 · 3 comments
Labels
topic-free-threading type-feature A feature request or enhancement

Comments

@Fidget-Spinner
Copy link
Member

Fidget-Spinner commented Jul 7, 2024

Feature or enhancement

Proposal:

PEP 703 proposes deferred reference counting to reduce contention between threads on shared objects' reference count fields.

This issue is not in conflict with Faster CPython's scheme of fully removing reference counts in the eval loop. In fact, some of the work runs parallel to it and will actually help it.

There are 3 wins I can observe right now:

  • deferring LOAD_GLOBAL
  • deferring LOAD_ATTR
  • deferring frames' strong references on the code object and function (this is the hardest of the three)

I shall proceed in this order.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@Fidget-Spinner
Copy link
Member Author

This is implemented now.

@picnixz
Copy link
Member

picnixz commented Dec 14, 2024

What about #124101? should this one be considered as optional?

@Fidget-Spinner
Copy link
Member Author

@picnixz I'm waiting for the porting over the specializing intepreter to free threaded build to play out. If that works for LOAD_ATTR we wont need the PR anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-free-threading type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants