[MLton-devel] finalization
Henry Cejtin
henry@sourcelight.com
Fri, 9 May 2003 15:37:27 -0500
The one problem with my notion of waitForGC is that currently there is no
context switching notion (or ready queue) built in to the compiler, and as
Matthew says, you need something to help you here. A problem, I think, with
something like installAfterGC is that it makes it a bit harder (not
impossible certainly) to implement things like critical sections where you
don't want any finalizers to be called. Mind you, it isn't easy to do this
with waitForGC either, but it seems a bit cleaner.
Any way, it is just a thought since as I said, the notion of finalizers
running in a separate thread seems to be the right one to me, and it doesn't
look like a big change to the runtime system, and would give us fully
automatic finalizers.
Maybe Matthew's installAfterGC is the way to go, but then you would need to
have some kind of hook to delay the finalization. If `user code' implemented
its own stuff using installAfterGC, then all is well, but if we add finalized
objects to the `system', then code which needed to do this would have to not
use ours and modify the code. I.e., it is the kind of thing that in Emacs
would use a few hook functions some where. (Yuck.)
I think that the exact notion and semantics aren't quite there yet.
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel