gh-111569: Implement Python critical section API by colesbury · Pull Request #111571 · python/cpython

@colesbury

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.

zooba

ericsnowcurrently

@colesbury

colesbury

@colesbury

@colesbury

@colesbury

ericsnowcurrently

@colesbury

ericsnowcurrently

aisk pushed a commit to aisk/cpython that referenced this pull request

Feb 11, 2024
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.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request

Sep 2, 2024
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.