From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,aef01dc1d0a3a8bd X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: Dummy Date: 2000/02/10 Message-ID: <38A212E8.C5552776@research.canon.com.au>#1/1 X-Deja-AN: 583922384 Content-Transfer-Encoding: 8bit References: <387b154a.3533365@newsread.albacom.net><3898C380.BC01EC03@earthlink.net> <3899DB45.B481F8E2@averstar.com><87bt5wlt8l.fsf@deneb.cygnus.argh.org> <87jghc$oj5$3@wanadoo.fr> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@research.canon.com.au X-Trace: cass.research.canon.com.au 950145741 18037 203.12.174.227 (10 Feb 2000 01:22:21 GMT) Organization: Canon Information Systems Research Australia Mime-Version: 1.0 NNTP-Posting-Date: 10 Feb 2000 01:22:21 GMT Newsgroups: comp.lang.ada Date: 2000-02-10T01:22:21+00:00 List-Id: Jean-Pierre Rosen wrote: > > Robert A Duff a �crit dans le message : > wcc66w4rcy5.fsf@world.std.com... > > Florian Weimer writes: > > > > > Does this mean that that the finalization of local variables is > > > non-deterministic in Java? Ugh. > > > > Yes. Finalization happens in Java whenever the garbage collector gets > > around to noticing that it's needed. > > > It's even worse. The finalization routine is allowed to resurect the object > (for example, by assigning it to some live variable), however it is > guaranteed that in that case, finalization will *not* be invoked again, when > the object becomes inaccessible for the second time. It's even worse, although finalizers in Java are guaranteed to be never invoked more than once, the are not guaranteed to be invoked at least once. This makes finalizers essentially useless for cleaning up resources etc. It used to be possible to ask the VM to run finalizers at exit, but that method has been deprecated.