'import ccall unsafe' and parallelism

Donn Cave donn at avvanta.com
Thu Aug 14 16:21:11 UTC 2014


I'm no judge of what's true about safe and unsafe, but this account of
the system has at least to my ear the ring of authenticity:

http://blog.melding-monads.com/2011/10/24/concurrency-and-foreign-functions-in-the-glasgow-haskell-compiler/

The FFI section is short and readable.

With respect to whether "unsafe" does or does not block other threads,
I can never penetrate the verbiage about capabilities to know for sure
what to expect in practice, but when I checked, in practice, "unsafe"
blocks other threads.  I use "safe" to avoid this.

	Donn


More information about the Glasgow-haskell-users mailing list