[Mono-devel-list] Patch that implements WaitForPendingFinalizers

Gonzalo Paniagua Javier gonzalo at ximian.com
Thu Apr 17 10:55:35 EDT 2003


El jue, 17 de 04 de 2003 a las 16:41, Jeroen Frijters escribió:
> I'm not sure if this is handled, but have you considered what happens if
> the code inside the finalizer instantiates new objects that also have a
> finalizer, you'll possibly be finalizing forever. I think that on
> AppDomain unload Microsoft actually watches the number of objects on the
> finalizer queue, and if it doesn't go down, it just stops calling the
> finalizers.

That depends on entirely on Boehm GC. 

Btw, the documentation on WaitForPendingFinalizers says "...there is no
guarantee that this method will terminate...", thought they propose
interrupting the thread that called WaitFormPendingFinalizers as an
alternative.

In the AppDomain.Unload documentation they say, for example, "Althought
the thread should terminate promptly, it can continue executing for an
unpredictable amount of time in its finally clause" and "A long period
of time can pass before domain unloads because it maight be difficult to
terminate executing threads".

-Gonzalo





More information about the Mono-devel-list mailing list