[gclist] The requirments of finalizers and their consequences.
Hans Boehm
boehm@hoh.mti.sgi.com
Mon, 14 Oct 1996 17:52:51 -0700
"Everyone seems to agree that finalizers need to be sure.
Everything constructed need to be finalized if only at
end of job."
I disagree with that, too. Ideally there should be no need to release
resources at process termination. If there is such a need, then a crashed
process will leak.
In real life there tend to be resources that must be released at process exit.
But general finalizers seem poorly suited to the task, since they would have
to run in an environment in which arbitrary global objecys have been finalized.
I think it's cleaner to do this with weak pointers and a routine that runs at
termination.
I put my view of these issues in
http://reality.sgi.com/employees/boehm_mti/finalization.html
Hans
--
Hans-Juergen Boehm
boehm@mti.sgi.com