[MLton] adding synchronous finalizers

Henry Cejtin henry@sourcelight.com
Thu, 30 Sep 2004 19:58:18 -0500


My point was that one might have multiple threads and still not want signals
to be handled automatically.  I.e., to handle them only during some kind of
poll call.  The same is the case for finalizers.  The reason would be that
that way I don't have to worry about things mutated in a signal handler and
another (single other) thread needing locks of any type.
I agree that it is also possible to want to poll for finalizers but not
signal handlers, or vice versa, but I don't know if that would be done
often (or at all). 
I really don't know what the right solution is.
My notion was (when I wrote the last mail) to have a signle poll function
and then a flag which takes one of the following values:
1. Nothing is done automatically, poll checks for signals and finalizers.
2. Both signals and finalizers are done automatically (poll does nothing).
3. Signals are automatic but finalizers are not, poll only checks finalizers.
4. Finalizers are automatic but signals are not, poll only checks signals.

I don't really like this.