The Revenge of Finalizers

George Russell ger at
Thu Oct 17 12:40:52 EDT 2002

Simon Marlow wrote:
> However, I think we're trying to solve a problem that doesn't exist yet.
> All the libraries we have which are affected can be fixed by using
> atomicModifyIORef, and even if one were to arrive which can't be fixed
> in this way, the chances that someone would also want to use it from a
> finalizer are rather low.
> I think a more pressing problem is whether Haskell finalizers can be
> implemented in Hugs properly - any thoughts on the problem I raised
> earlier?
Yes, I agree.  I really think that now we can consider the problem of
whether it is possible to do useful communication between finalizers
and the rest of the Haskell world to have been settled in the affirmative.

> PS. I've implemented atomicModifyIORef in GHC and am testing it now.
Yippee.  I shall look forward to using it, especially if it is faster
than the equivalent construction using modifyMVar.

More information about the FFI mailing list