[Haskell-cafe] Unbound threads and FFI

Simon Marlow simonmar at microsoft.com
Wed Dec 14 11:39:43 EST 2005

On 14 December 2005 15:34, Joel Reymont wrote:

> On Dec 14, 2005, at 3:21 PM, Simon Marlow wrote:
>> this only happens in the -threaded RTS, in the non-threaded RTS a FFI
>> call will block all the other Haskell threads.
> Just to be absolutely sure... Does the above apply to safe _and_
> unsafe FFI?
> I have been using the non-threaded runtime with unsafe FFI calls
> (OpenSSL, Zlib) and I do not believe my runtime was being blocked.
> Maybe I just didn't notice it, though.

Maybe this little table will help:

Do other Haskell threads get blocked during an FFI call?

              | safe    unsafe
 -threaded    | NO      YES
 no -threaded | YES     YES


More information about the Haskell-Cafe mailing list