-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Closed
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
The defaulttimeout
in socketmodule.c
is shared, mutable state:
cpython/Modules/socketmodule.c
Line 551 in 9f983e0
PyTime_t defaulttimeout; |
In the free-threaded build, we should use relaxed atomic operations to access defaulttimeout
to avoid data races. This probably requires adding wrappers for 64-bit relaxed atomic load and stores to https://github.com/python/cpython/blob/main/Include/internal/pycore_pyatomic_ft_wrappers.h. Note that _PyTime_t
is a typedef for int64_t
.
For context, here is a similar change from nogil-3.12
, but note that defaulttimeout
is now part of the module state:
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement