Finalizers Ride Again

George Russell ger at
Wed Oct 16 09:31:21 EDT 2002

Alastair Reid wrote:
> > [snip] I don't see that it's necessary for us to come to a decision
> > right now about PVars unless we want to put them in the FFI
> > standard.
> But what if we can't agree on something like PVars or we decide that
> Haskell finalizers plus yet another synchronization mechanism is worse
> than C finalizers?

Well the first problem (not agreeing on something) is a problem for the
Mutable State Standardisation committee (not us).  As for "Haskell finalizers
plus yet another synchronization mechanism", PVar's are
not "yet another synchronization mechanism" because the whole point is that
NHC at least has no synchronization mechanism, and if we are going to have
a standard synchronization mechanism (which as I've argued is a good idea)
something like PVars are needed, if we are to take it that P/V/MVars are all
impossible.  Even if there were no FFI standard, I think PVars or something
like them would be a good idea, otherwise it would be impossible to write functions
like Alastair's newObject/killObject so that they could be ported between NHC
and other Haskell systems.

More information about the FFI mailing list