[Haskell-cafe] Unbound threads and FFI
simonpj at microsoft.com
Fri Dec 16 04:23:13 EST 2005
I've added a FAQ.
| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of
| Simon Marlow
| Sent: 15 December 2005 09:26
| To: Bulat Ziganshin
| Cc: Haskell-Cafe Cafe
| Subject: RE: Re: [Haskell-cafe] Unbound threads and FFI
| On 14 December 2005 18:04, Bulat Ziganshin wrote:
| > Hello Simon,
| > Wednesday, December 14, 2005, 7:39:43 PM, you wrote:
| >> Do other Haskell threads get blocked during an FFI call?
| >> | safe unsafe
| >> --------------+----------------
| >> -threaded | NO YES
| >> no -threaded | YES YES
| > there is also `threadsafe` specifier. i don't understand from the
| > what it exactly means?
| > ghc commentary says:
| > To signal that you want an external call to be serviced by a
| > OS thread, you have to add the attribute threadsafe to a foreign
| > import declaration, i.e.,
| > foreign import "bigComp" threadsafe largeComputation :: Int -> IO ()
| > The distinction between 'safe' and thread-safe C calls is made so
| > we may call external functions that aren't re-entrant but may cause
| > GC to occur.
| > The threadsafe attribute subsumes safe.
| threadsafe is deprecated; it is currently exactly the same as safe.
| thought at one time that it would be useful to have the distinction,
| it turned out to be impractical to implement safe that wasn't also
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
More information about the Haskell-Cafe