Feature or enhancement
The defaulttimeout in socketmodule.c is shared, mutable state:
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
Feature or enhancement
The
defaulttimeoutinsocketmodule.cis shared, mutable state:cpython/Modules/socketmodule.c
Line 551 in 9f983e0
In the free-threaded build, we should use relaxed atomic operations to access
defaulttimeoutto 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_tis a typedef forint64_t.For context, here is a similar change from
nogil-3.12, but note thatdefaulttimeoutis now part of the module state:Linked PRs