FFI, safe vs unsafe

Simon Marlow simonmar at microsoft.com
Thu Apr 13 07:54:30 EDT 2006

On 13 April 2006 10:02, Marcin 'Qrczak' Kowalczyk wrote:

> John Meacham <john at repetae.net> writes:
>> Checking thread local state for _every_ foregin call is definitly
>> not an option either. (but for specificially annotated ones it is
>> fine.)
> BTW, does Haskell support foreign code calling Haskell in a thread
> which the Haskell runtime has not seen before? Does it work in GHC?

Yes, yes.

> If so, does it show the same ThreadId from that point until OS
> thread's death (like in Kogut), or a new ThreadId for each callback
> (like in Python)?

A new ThreadId, but that's not a conscious design decision, just a
symptom of the fact that we don't re-use old threads.


More information about the Haskell-prime mailing list