The Revenge of Finalizers

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Thu Oct 17 08:02:52 EDT 2002


Alastair:
>   On a system where finalizers behave like preemptive threads
> [nonsense deleted]

My outline of consequences/ implementation for GHC-like systems was
completely wrong because I was still thinking about finalizers as
special cases.

What needs to happen on GHC-like systems is that runAtomically takes a
global lock (just a plain lock, not a reader-writer lock) when it
starts and releases that lock when it ends.  Finalizers don't do
anything special when they start or end and they don't get blocked in
any special way.  Finalizers just take and release the lock the same
as anyone else.

--
Alastair



More information about the FFI mailing list