[Haskell-cafe] Why do "unsafe" foreign calls block other threads?

Daniel Peebles pumpkingod at gmail.com
Tue Aug 3 17:58:41 EDT 2010

It's a matter of perspective. Either the function you're FFI'ing to is
safe/unsafe or your use of it is safe/unsafe. The FFI spec seems to be using
the former, so if you think that the function you're calling is unsafe
(i.e., can call back into Haskell) then it blocks the world.

But I do think it's unintuitive and a less ambiguous naming scheme would be

On Tue, Aug 3, 2010 at 11:54 PM, Gregory Crosswhite <
gcross at phys.washington.edu> wrote:

>  Hey everyone,
> Could someone explain to me the logic behind having "unsafe" calls block
> other threads from executing?  It seems to me that if anything it would
> make more sense for "safe" calls to block other threads since the call
> can call back into the Haskell runtime, as opposed to "unsafe" calls
> which (by assertion) will never call back into Haskell and therefore
> should be safer to run in parallel with other threads.  What am I
> missing here?
> Cheers,
> Greg
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100803/7ddbfbe4/attachment.html

More information about the Haskell-Cafe mailing list