Skip to content

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

Merged
kumaraditya303 merged 9 commits into
python:mainfrom
Fidget-Spinner:lock_asyncio
Jul 14, 2024
Merged

gh-121621: Use PyMutex for writes to asyncio state#121622
kumaraditya303 merged 9 commits into
python:mainfrom
Fidget-Spinner:lock_asyncio

Conversation

@Fidget-Spinner

@Fidget-SpinnerFidget-Spinner commented Jul 11, 2024

Copy link
Copy Markdown
Member

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mutex locking should be limited to the free-threaded build. You can define some macros that that lock the mutex, but are are no-ops if Py_GIL_DISABLED is not defined.

Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
@kumaraditya303kumaraditya303 self-assigned this Jul 12, 2024
Comment threadModules/_asynciomodule.c
Comment threadInclude/internal/pycore_pyatomic_ft_wrappers.h Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with one minor comment. It'd be good to get @kumaraditya303's feedback as well.

Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
@kumaraditya303
kumaraditya303 enabled auto-merge (squash) July 14, 2024 12:00
@kumaraditya303
kumaraditya303 merged commit 5d6861a into python:mainJul 14, 2024
@Fidget-Spinner
Fidget-Spinner deleted the lock_asyncio branch July 14, 2024 13:03
@Fidget-Spinner

Copy link
Copy Markdown
MemberAuthor

Thanks @kumaraditya303 for the reviews!

@colesburycolesbury added the needs backport to 3.13 bugs and security fixes label Jul 14, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @Fidget-Spinner for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @Fidget-Spinner and @kumaraditya303, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 5d6861ad06b524358f52603f242e7c0d57532a58 3.13

colesbury pushed a commit to colesbury/cpython that referenced this pull request Jul 14, 2024
…onGH-121622)
(cherry picked from commit 5d6861a)
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@bedevere-app

Copy link
Copy Markdown

GH-121774 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Jul 14, 2024
kumaraditya303 added a commit that referenced this pull request Jul 15, 2024
…#121774)
(cherry picked from commit 5d6861a)
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Fidget-Spinner@colesbury@kumaraditya303