[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DotGNU]Finalization

From: Thong \(Tum\) Nguyen
Subject: RE: [DotGNU]Finalization
Date: Sun, 22 Jun 2003 21:52:23 +1200

Ahh that makes sense.  I've got another problem though...

Check out this code:

using System;

public class TestFinalizer
        public class Pok

        public static void Main()
                new Pok();
                new Pok();
                new Pok();


It should print out "finalized!" thrice but it only prints it out once.
It looks like the first (and only the first) finalizable object is never

I can't trace down the problem.  

PS.  I have monitors working and finalizers are now running on a
separate thread :D.



> -----Original Message-----
> From: Rhys Weatherley [mailto:address@hidden
> Sent: Sunday, 22 June 2003 12:50 p.m.
> To: Thong (Tum) Nguyen; address@hidden
> Subject: Re: [DotGNU]Finalization
> On Sunday 22 June 2003 10:28 am, Thong \(Tum\) Nguyen wrote:
> > It should print out "finalized!".
> Actually, it is doing the right thing for "WaitForPendingFinalizers".
If you
> put "GC.Collect" just before the "WaitForPendingFinalizers" call, then
> will print things.
> I tried it out on MS'es engine and the "WaitForPendingFinalizers"
didn't do
> anything either (because the GC hadn't run yet).  But once the engine
> down, it printed the messages.
> The problem is that we weren't running a final GC pass during engine
> to run the remaining finalizers.  I just added this to
> and it seems to work now.  However, it will probably need adjusting
> threads are added to the system to properly shutdown the finalizer
> Cheers,
> Rhys.
> _______________________________________________
> Developers mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]