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

Nick Bowler nbowler at elliptictech.com
Thu Aug 5 16:08:38 EDT 2010

On 2010-08-03 15:23 -0700, John Meacham wrote:
> It is more an accident of ghc's design than anything, the same mechanism
> that allowed threads to call back into the runtime also allowed them to
> be non blocking so the previously used 'safe' and 'unsafe' terms got
> re-used. personally, I really don't like those terms, they are
> non-descriptive in terms of what they actually mean and presuppose a RTS
> similar to ghcs current design. 'reentrant' and 'blocking' which could
> be specified independently would be better and would be more
> future-proof against changes in the RTS or between compilers.

I thought "safe" meant "the foreign function is allowed to call Haskell
functions", which seems to not have anything to do with whether the
function is re-entrant (a very strong condition).

Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)

More information about the Haskell-Cafe mailing list