[Python-Dev] PEP 556: Threaded garbage collection

Antoine Pitrou solipsis at pitrou.net
Fri Sep 8 15:13:46 EDT 2017


On Fri, 08 Sep 2017 12:04:10 -0700
Benjamin Peterson <benjamin at python.org> wrote:
> I like it overall.
> 
> - I was wondering what happens during interpreter shutdown. I see you
> have that listed as a open issue. How about simply shutting down the
> finalization thread and not guaranteeing that finalizers are actually
> ever run à la Java?

I don't know.  People generally have expectations towards stuff being
finalized properly (especially when talking about files etc.).
Once the first implementation is devised, we will know more about
what's workable (perhaps we'll have to move _PyGC_Fini earlier in the
shutdown sequence?  perhaps we'll want to switch back to serial mode
when shutting down?).

> - Why not run all (Python) finalizers on the thread and not just ones
> from cycles?

Because a lot of code probably expects them to be run as soon as the
last visible ref disappears.

Regards

Antoine.




More information about the Python-Dev mailing list