I suggest reading Boehm's classic paper "Destructors, Finalizers and
Synchronization" (http://www.hpl.hp.com/techreports/2002/HPL-2002-335.pdf,
slides at http://www.hpl.hp.com/personal/Hans_Boehm/popl03/slides.pdf)
before starting yet another finalizer thread (pun intended ;-). The problem
is that the issues regarding finalizers are commonly misunderstood, which
includes the people who wrote the initial Java spec. I am 99% sure that I
read in some interview with James Gosling or Bill Joy that they even regret
having finalizers in the spec now, kudos to anybody who can dig up an URL
for this.

Regarding C#'s 'using': In a language with first class functions, having a
special syntactic construct is not even necessary, see e.g. 'bracket' in
Haskell (
http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.5.1.0/Control-Exception.html#v:bracket).
So if you want to have tight control over the lifetime of your external
objects/resources, wrap your usage patterns into higher-order functions and
enjoy... :-)

Cheers,
   S.

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to