diff options
author | Sam Gross <colesbury@gmail.com> | 2023-12-11 18:33:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 18:33:21 (GMT) |
commit | d70e27f25886e3ac1aa9fcc2d44dd38b4001d8bb (patch) | |
tree | 28224318895d4644eb75abd41004df9eb0ed3305 /Python/pystrhex.c | |
parent | 0738b9a338fd27ff2d4456dd9c15801a8858ffd9 (diff) | |
download | cpython-d70e27f25886e3ac1aa9fcc2d44dd38b4001d8bb.zip cpython-d70e27f25886e3ac1aa9fcc2d44dd38b4001d8bb.tar.gz cpython-d70e27f25886e3ac1aa9fcc2d44dd38b4001d8bb.tar.bz2 |
gh-112529: Use atomic operations for `gcstate->collecting` (#112533)
* gh-112529: Use atomic operations for `gcstate->collecting`
The `collecting` field in `GCState` is used to prevent overlapping garbage
collections within the same interpreter. This is updated to use atomic
operations in order to be thread-safe in `--disable-gil` builds.
The GC code is refactored a bit to support this. More of the logic is pushed
down to `gc_collect_main()` so that we can safely order the logic setting
`collecting`, the selection of the generation, and the invocation of callbacks
with respect to the atomic operations and the (future) stop-the-world pauses.
The change uses atomic operations for both `--disable-gil` and the default
build (with the GIL) to avoid extra `#ifdef` guards and ease the maintenance
burden.
Diffstat (limited to 'Python/pystrhex.c')
0 files changed, 0 insertions, 0 deletions