[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] force finalizers only if finalizers exist
From: |
felix . winkelmann |
Subject: |
Re: [PATCH] force finalizers only if finalizers exist |
Date: |
Wed, 06 May 2020 11:42:18 +0200 |
> There might be a situation where a thread is already executing
> ##sys#run-pending-finalizers, but has run out of its time slice, or gc
> interrupted or something. In this situation running
> ##sys#run-pending-finalizers only once might not be enough.
This is basically true, but with threads we make no effort to terminate
them properly once the main thread exists - all unjoined threads will die
anyway,
regardless of what they are currently doing.
Also, the interplay between threads and finalizers is more or less
undefined - interrupts are executed in whatever thread happens to be
active and manually forcing finalizers in a different thread than the
main thread is already asking for trouble. This is a known problem of
the threading/interrupt system and needs to be solved differently.
felix