Minor tweaks to ffi addendum

Alastair Reid reid at cs.utah.edu
Mon Jun 3 11:10:17 EDT 2002


> Alternatively, we could have an explicit operation
>
> 	runFinalizers :: IO ()
>
> which causes finalizers to run in a non-pre-emptive or
> non-concurrent system.

Of course, this solution is no use at all if your use of ffi is to
pull a big mostly pure C library into Haskell.  

On two separate occasions, I've added interfaces to image processing
libraries where pretty much every function was pure (it either
generated a fresh image or returned an Int, Float or whatever).
Images tend to be big (640x400x24bits is 3/4 Mbyte) so a few dozen
image processing steps might quickly use up a lot of memory - and in
all that time you don't go anywhere near the IO monad.

-- 
Alastair Reid        reid at cs.utah.edu        http://www.cs.utah.edu/~reid/



More information about the FFI mailing list