Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make functools.lru_cache thread-safe in --disable-gil builds #112070

Copy link
Copy link
Closed
@colesbury

Description

@colesbury
Issue body actions

Feature or enhancement

We should make functools.lru_cache thread-safe in the --disable-gil builds.

For context, here is the commit from the nogil-3.12 fork: colesbury/nogil-3.12@041a08e339

NOTES (differences in 3.13 from nogil-3.12):

  1. No need for an extra mutex in lru_cache_object; every PyObject has a mutex in the --disable-gil builds
  2. For _functools__lru_cache_wrapper_cache_info_impl and _functools__lru_cache_wrapper_cache_clear_impl we should instead use the @critical_section Arugment Clinic directive. This will be simpler and require fewer changes to the code. lru_cache_call still needs explicit calls to the critical section API.

Linked PRs

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.