Commit graph

2 commits

Author SHA1 Message Date
Sam Gross 375b723d58
gh-120858: PyDict_Next should not lock the dict (#120859)
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.

The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
2024-06-24 14:15:15 -04:00
Sam Gross 02b272b702
gh-119241: Add HOWTO for free-threaded C API extensions (#119877)
Some sections adapted from https://github.com/Quansight-Labs/free-threaded-compatibility/
written by Nathan Goldbaum.

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2024-06-18 09:49:51 -04:00