[Python-Dev] PEP 556: Threaded garbage collection

Antoine Pitrou solipsis at pitrou.net
Fri Sep 8 15:49:08 EDT 2017

On Fri, 8 Sep 2017 12:40:34 -0700
Nathaniel Smith <njs at pobox.com> wrote:
> PyPy just abandons everything when shutting down, instead of running
> finalizers. See the last paragraph of :
> http://doc.pypy.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies
> So that might be a useful source of experience.

CPython can be embedded in applications, though, and that is why we try
to be a bit more thorough during the interpreter cleanup phase.

> Would it make sense to also move signal handlers to run in this
> thread? Those are the other major source of nasty re-entrancy
> problems.

See the "Non-goals" section in the PEP, they are already mentioned
there :-)

Note I don't think signal handlers are a major source of reentrancy
problems, rather minor, since usually you don't try to do much in a
signal handler.  Signal handling is mostly a relic of 70s Unix design
and it has less and less relevance in today's world, apart from the
trivial task of telling a process to shut down.



More information about the Python-Dev mailing list