Thread-Safety through FFI

Simon Marlow
Thu, 25 Oct 2001 12:34:38 +0100

> >This might work, but no guarantees.
> OK, so I'd be better off making sure all Haskell runs in one=20
> OS-thread.

My concerns still apply - non-thread-friendly library calls may mean
that GHC's RTS interacts badly with the rest of your threaded program.

> Although presumably I can use Haskell-threads: I can have a special=20
> Haskell-thread that handled a queue of incoming execution requests,=20
> firing off a new Haskell-thread for each one. And then I could have a=20
> native-code mechanism to allow asynchronous additions to the queue.

Yes, there's no restriction on using Haskell threads because they're
handled internally by the RTS.