]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-111569: Implement Python critical section API (gh-111571)
authorSam Gross <colesbury@gmail.com>
Wed, 8 Nov 2023 22:39:29 +0000 (17:39 -0500)
committerGitHub <noreply@github.com>
Wed, 8 Nov 2023 22:39:29 +0000 (15:39 -0700)
commit31c90d5838e8d6e4c47d98500a34810ccb33a6d4
tree5be595b11ca17cf1f1bd5875a69a04b927f10dff
parent0b718e6407da65b838576a2459d630824ca62155
gh-111569: Implement Python critical section API (gh-111571)

Critical sections are helpers to replace the global interpreter lock
with finer grained locking.  They provide similar guarantees to the GIL
and avoid the deadlock risk that plain locking involves.  Critical
sections are implicitly ended whenever the GIL would be released.  They
are resumed when the GIL would be acquired.  Nested critical sections
behave as if the sections were interleaved.
19 files changed:
Include/cpython/pystate.h
Include/internal/pycore_critical_section.h [new file with mode: 0644]
Include/internal/pycore_lock.h
Include/object.h
Makefile.pre.in
Misc/NEWS.d/next/C API/2023-10-31-14-58-17.gh-issue-111569._V8iu4.rst [new file with mode: 0644]
Modules/Setup.stdlib.in
Modules/_testinternalcapi.c
Modules/_testinternalcapi/parts.h
Modules/_testinternalcapi/test_critical_sections.c [new file with mode: 0644]
Objects/object.c
PCbuild/_freeze_module.vcxproj
PCbuild/_freeze_module.vcxproj.filters
PCbuild/_testinternalcapi.vcxproj
PCbuild/_testinternalcapi.vcxproj.filters
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/critical_section.c [new file with mode: 0644]
Python/pystate.c