Skip to content

gh-116616: Use relaxed atomic ops to access socket module defaulttimeout - #116623

Merged
erlend-aasland merged 1 commit into
python:mainfrom
erlend-aasland:nogil/socket
Mar 12, 2024
Merged

gh-116616: Use relaxed atomic ops to access socket module defaulttimeout#116623
erlend-aasland merged 1 commit into
python:mainfrom
erlend-aasland:nogil/socket

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Mar 11, 2024

Copy link
Copy Markdown
Contributor

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

@colesbury, there's also a store in the module exec function. Let me if we need to use atomic access these as well.

@colesbury

Copy link
Copy Markdown
Contributor

there's also a store in the module exec function...

I don't think we need atomics for the initialization in the module exec function. The module state is not visible to other threads at that point, and the internal import locks provide the necessary synchronization.

@erlend-aasland
erlend-aasland merged commit 3b7fe11 into python:mainMar 12, 2024
@erlend-aasland
erlend-aasland deleted the nogil/socket branch March 12, 2024 13:44
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks for the patch and the review, @colesbury 😅

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…lttimeout (python#116623)
Co-authored-by: Sam Gross <colesbury@gmail.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…lttimeout (python#116623)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

socketmodule.c: use atomics to access defaulttimeout in free-threaded build

2 participants

@erlend-aasland@colesbury