Finalizers etcetera

Alastair Reid alastair at
Wed Oct 9 08:33:59 EDT 2002

> c) On systems (like Hugs and NHC) that have no synchronisation
> primitives, you have to roll your own by calling C procedures.

Just to be clear about this.

You are not rolling your own synchronization primitive, you are 
writing code that is guaranteed to contain no preemption points
because it does not call Haskell.

I don't know how to write synchronization primitives in C.
Traditional thread mutexes don't do the job because they act on the
thread scheduler (provided by libpthread or whatever) not on the
finalizer scheduler (implemented in the runtime system).


More information about the FFI mailing list