[Haskell-cafe] Haskell FFI and finalizers

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Oct 3 12:45:21 EDT 2007

Hello Maxime,

Wednesday, October 3, 2007, 7:57:58 PM, you wrote:

> And then I discovered Foreign.Concurrent, which allows one to associate
> a plain Haskell IO action to a pointer.  The 'Foreign.Concurrent' name
> is a bit misleading to me; it seems this module is named so because it
> needs concurrency itself, rather than providing stuff for concurrency.

such finalizer cannot be run w/o concurrency support. you can find
explanations in module docs. shortly speaking, finalizing occurs at
time of GC and there is no way to run Haskell code at this moment
except than using another Haskell thread

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list