You do have to worry about the impact of running Haskell finalizers
at any point during execution of Haskell code. Since you can't do
any concurrency synchronisation between the finalizer and the main
Haskell thread, shared access to mutable data is impossible. This
is just something
Alastair Reid wrote:
[snip]
I maintain that it is better to specify something simple and for GHC
to document that it goes beyond the specification just as it does for
unboxed types and the like.
I don't believe it's at all simple to specify that Haskell-land may not
be invoked at any time
In fairness I should state that here at Bremen we do not currently need Haskell
finalizers.
I was thinking of another application altogether, but I don't particularly want to go
into
details of that. There are however particular reasons (such as galloping concurrency)
why
I think Alastair's