Proposed change to ForeignPtr

Malcolm Wallace Malcolm.Wallace at
Tue Sep 10 12:40:53 EDT 2002

George Russell <ger at> writes:

> However in the case I cited it isn't particularly important to execute
> the callback at once.  If calling Haskell at arbitrary times is
> unimplementable, could there instead be some way of some way like
> "wrapper" of exporting a Haskell function[args] -> IO () so that the
> resulting C function, when executed, merely registers the Haskell action
> to be executed as soon as the Haskell RTS finds it convenient, rather
> than at once?

This was the originally proposed solution for re-entrant finalisers
in nhc98 and Hugs.  The problem is that, certainly for nhc98, it is
nigh impossible for the RTS to identify a "convenient" later moment
at which to run the delayed finaliser.


More information about the FFI mailing list