felix.winkelm...@bevuta.com writes:
>> On 2020-04-07 14:51, felix.winkelm...@bevuta.com wrote: >> > > > This patch disables the final GC for finalizer forcing at normal >> > > > program termination >> > > > if no finalizers are live as the GC is unnecessary in such cases. >> > > >> > > How about possible pending finalizers? >> > >> > You mean pending from a previous GC? I'm not sure - shouldn't they already >> > be executed at this stage? >> >> Hey megane, could you go into a bit more detail about this? >> >> If I understand correctly, you mean that some finalizers that have been >> moved onto the pending_finalizers_symbol may not have been invoked by >> this point, but will also not included in the C_i_live_finalizers_count, >> is that right? That seems right to me, but it's not clear to me what the >> check should rather be. >> > > live_finalizer_count gets decreased when a pending finalizer is inserted > into the pending finalizers lists, so I understand that the live count does > not > include the pending ones. But the ones pending are not automatically run, > so it may be that before exiting we may have to do a final > ##sys#run-pending-finalizers. > I will submit a modified patch. Yeah that sounds about right. 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. > > > felix