[Haskell-cafe] Consecutive FFI calls

Edward Z. Yang ezyang at mit.edu
Wed Jun 3 18:58:28 UTC 2015


The ordering is guaranteed, because full synchronization is used
when threads migrate.  (It goes something like, a capability with
a full run queue grabs all idle capabilities, distributes its
threads to those capabilities, and then releases them.  The act
of acquiring and releasing a capability is a synchronization point.)

Cheers,
Edward

Excerpts from David Turner's message of 2015-05-28 09:24:50 -0700:
> Hi,
> 
> If I make a sequence of FFI calls (on a single Haskell thread) but
> which end up being called from different OS threads, is there any kind
> of ordering guarantee given? More specifically, is there a full memory
> barrier at the point where a Haskell thread migrates to a new OS
> thread?
> 
> Many thanks,
> 
> David


More information about the ghc-devs mailing list