[Haskell-cafe] concurrency vs. I/O in GHC

wren ng thornton wren at freegeek.org
Sat Oct 23 19:20:07 EDT 2010


On 10/23/10 2:33 PM, Brandon S Allbery KF8NH wrote:
> I think they mean "please don't conflate `reentrant' with `blocking' in the
> FFI".

Not knowing much about the guts of GHC's implementation of the FFI, I 
wonder if there would actually be an implementational difference in 
distinguishing blocking calls vs calls with (potentially) callbacks, or 
if it's just a terminology problem.

Also, we should be distinguishing between C functions which are 
non-reentrant ---and so we'd want to block all other GHC threads from 
calling it before the first invocation returns[1]---, vs when the GHC 
runtime doesn't get itself into a reenterable state before invoking 
foreign calls.

[1] Presumably this should be considered a library problem (e.g., use 
locks) rather than an FFI problem per se.

-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list