GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make `functools.lru_cache` thread-safe in `--disable-gil` builds · Issue #112070 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
#112111
Closed
Make functools.lru_cache thread-safe in --disable-gil builds#112070
#112111
Copy link
Assignees
wanderxjtu
Labels
3.13only security fixesonly security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement

Description

@colesbury
colesbury
opened on Nov 14, 2023
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

  • gh-112070: make functools.lru_cache threadsafe in --disable-gil build #112111

Activity

  1. colesbury
    added
    type-featureA feature request or enhancementA feature request or enhancement
    3.13only security fixesonly security fixes
    topic-free-threading
    on Nov 14, 2023
  2. AlexWaygood
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Nov 14, 2023
  3. wanderxjtu commented on Nov 15, 2023

    @wanderxjtu
    wanderxjtu
    on Nov 15, 2023
    Contributor
    More actions

    I will try on it.

    Reacted by Sam Gross
  4. wanderxjtu
    added 6 commits that reference this issue on Nov 15, 2023

    pythongh-112070: make `functools.lrucacle` threadsafe in --disable-gi…

    cb84c37

    pythongh-112070: make `functools.lrucacle` threadsafe in --disable-gi…

    f243dbd

    pythongh-112070: add NEWS file

    b9b6643

    pythongh-112070: update generate `functoolsmodule` files

    daec45a

    pythongh-112070: update generate `functoolsmodule` files

    3bddf43

    pythongh-112070: add NEWS file

    9d75348
  5. colesbury
    assigned
    wanderxjtu
    on Nov 15, 2023
  6. wanderxjtu
    added a commit that references this issue on Nov 16, 2023

    pythongh-112070: reformat functoolsmodule.c

    0fc873c
  7. corona10
    closed this as completedin #112111on Nov 17, 2023
  8. corona10
    added a commit that references this issue on Nov 17, 2023

    gh-112070: make `functools.lru_cache` threadsafe in --disable-gil bui…

    0ee2d77
  9. aisk
    added a commit that references this issue on Feb 11, 2024

    pythongh-112070: make `functools.lru_cache` threadsafe in --disable-g…

    d132795
  10. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-112070: make `functools.lru_cache` threadsafe in --disable-g…

    3ab4905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @wanderxjtu
    wanderxjtu

Labels

3.13only security fixesonly security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.