> > there should be no system guarantee that
> > finalizers are run on program exit
>
> That paper seems interesting, I'll have a look at it.
> Currenlty, the libraries rely on finalizers being run on
> program exit -
> the buffers for stdout and stderr have to be flushed (they are
> maintained in haskell land, so it's nothing that the OS takes
> care of).
> I didn't want to make extensive changes to the library, so I
> still made
> finalizers run on exit. I, too think that this should be changed at
> some point in the future.
The default Main.main could, in addition to wrapping an exception
handler around the program's main, also arrange to flush the standard
handles. This means that we could omit the final finalization step,
with two drawbacks: firstly, handles except the standard handles won't
necessarily get flushed when they're released, and secondly the final
flush of the standard handles may be delayed until the program exits
(previously it could happen earlier if the handle was unreferenced).
Also, we'd have to remove the guarantee that finalizers "run exactly
once". They would run "at most once", which makes me a bit uneasy to
say the least. But, finalizers are a swamp anyway - maybe making them a
bit more smelly isn't such a bad thing :-)
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc