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 — asyncio module state should be locked with mutexes in free-threaded builds · Issue #121621 · python/cpython

asyncio module state should be locked with mutexes in free-threaded builds #121621

New issue
Copy link
New issue
Copy link
Closed
Closed
asyncio module state should be locked with mutexes in free-threaded builds#121621
Copy link
Labels
topic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement

Description

@Fidget-Spinner
Fidget-Spinner
opened on Jul 11, 2024
Issue body actions

Feature or enhancement

Proposal:

Please see issue title.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-121621: Use PyMutex for writes to asyncio state #121622
  • gh-121621: Move asyncio running loop to thread state #121695
  • [3.13] gh-121621: Use PyMutex for writes to asyncio state (GH-121622) #121774
  • [3.13] gh-121621: Move asyncio running loop to thread state (GH-121695) #121864
  • gh-121621: Move asyncio freelist to thread state #121915
  • gh-121621: Move asyncio_running_loop to private struct #121939
  • [3.13] gh-121621: Move asyncio_running_loop to private struct (GH-121939) #121943
  • gh-121621: Disable asyncio freelist in free-threaded build #122046
  • [3.13] gh-121621: Disable asyncio freelist in free-threaded build (GH-122046) #122048

Activity

  1. Fidget-Spinner
    added
    type-featureA feature request or enhancementA feature request or enhancement
    topic-free-threading
    on Jul 11, 2024
  2. colesbury commented on Jul 11, 2024

    @colesbury
    colesbury
    on Jul 11, 2024
    Contributor
    More actions

    I think we also want to make enter_task, leave_task, and swap_current_task behave atomically. For example, enter_task makes two dict API calls that individually lock the dictionary, but the combined operation isn't atomic.

    I can think of two strategies for this:

    1. Try to replace multiple API calls with a single call. For example, I think enter_task may be able to use PyDict_SetDefaultRef and leave_task may be able to use _PyDict_DelItemIf with some modifications.
    2. Use a critical section to lock the dict and use the "lock held" variants.
  3. kumaraditya303
    added a commit that references this issue on Jul 14, 2024

    gh-121621: Use PyMutex for writes to asyncio state (#121622)

    5d6861a
  4. colesbury
    added a commit that references this issue on Jul 14, 2024

    [3.13] pythongh-121621: Use PyMutex for writes to asyncio state (pyth…

    e28808d
  5. kumaraditya303
    added a commit that references this issue on Jul 15, 2024

    [3.13] gh-121621: Use PyMutex for writes to asyncio state (GH-121622) (…

    a2a4f5e
  6. Fidget-Spinner
    added a commit that references this issue on Jul 16, 2024

    gh-121621: Move asyncio running loop to thread state (GH-121695)

    69c68de
  7. miss-islington
    added a commit that references this issue on Jul 16, 2024

    pythongh-121621: Move asyncio running loop to thread state (pythonGH-…

    efea984
  8. Fidget-Spinner
    added a commit that references this issue on Jul 16, 2024

    [3.13] gh-121621: Move asyncio running loop to thread state (GH-121695)…

    06d76c4
  9. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-121621: Use PyMutex for writes to asyncio state (python#121622)

    9bd2dd2
  10. colesbury
    added a commit that references this issue on Jul 17, 2024

    pythongh-121621: Move asyncio_running_loop to private struct

    d623558
  11. Yhg1s
    added a commit that references this issue on Jul 17, 2024

    gh-121621: Move asyncio_running_loop to private struct (#121939)

    81fd625
  12. miss-islington
    added a commit that references this issue on Jul 17, 2024

    pythongh-121621: Move asyncio_running_loop to private struct (pythonG…

    10b083d
  13. Yhg1s
    added a commit that references this issue on Jul 18, 2024

    [3.13] gh-121621: Move asyncio_running_loop to private struct (GH-121939

    afa5321
  14. colesbury
    added 4 commits that reference this issue on Jul 19, 2024

    pythongh-121621: Disable asyncio freelist in free-threaded build

    c1d4f44

    gh-121621: Disable asyncio freelist in free-threaded build (#122046)

    9724820

    [3.13] pythongh-121621: Disable asyncio freelist in free-threaded bui…

    022e244

    [3.13] gh-121621: Disable asyncio freelist in free-threaded build (GH…

    f3c79cb
  15. Fidget-Spinner commented on Jul 22, 2024

    @Fidget-Spinner
    Fidget-Spinner
    on Jul 22, 2024
    MemberAuthor
    More actions

    Fixed.

  16. Fidget-Spinner
    closed this as completedon Jul 22, 2024
  17. kumaraditya303
    added a commit that references this issue on Dec 18, 2024

    gh-121621: clear running loop early in asyncio (#128004)

    8a433b6
  18. srinivasreddy
    added a commit that references this issue on Jan 8, 2025

    pythongh-121621: clear running loop early in asyncio (python#128004)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-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.