Finalizers etcetera

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Sat Oct 12 13:10:49 EDT 2002


SimonM:
> Actually, I was claiming that if there's a problem there, then it's
> one you already have.  The reasoning I used is just that eval() can
> call a foreign function, which can re-enter Hugs.  My patch added no
> new code paths (as I said before).

I guess the Hugs documentation should say that using unsafePerformIO
to call C which calls Haskell should be avoided.  Off the top of my
head, I'd say that most legitimate (i.e., safe) uses of
unsafePerformIO don't have problems.  I think Haskell finalizers are
different: virtually every finalizer which manipulates Haskell state
will have race conditions.

--
Alastair



More information about the FFI mailing list