X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fcomm%2Frts-libs%2Fmulti-thread.html;fp=ghc%2Fdocs%2Fcomm%2Frts-libs%2Fmulti-thread.html;h=67a544be85983ef77469775538bd8a02fafe8155;hb=e199c200be63a0efcc8ac8fc63d69d96c5fc65bf;hp=d31a1d6d032f571f166b4d1d73bb03d3bbc1b24f;hpb=d8a9b534050f62f65d9db0d69aad9733f687ef8b;p=ghc-hetmet.git diff --git a/ghc/docs/comm/rts-libs/multi-thread.html b/ghc/docs/comm/rts-libs/multi-thread.html index d31a1d6..67a544b 100644 --- a/ghc/docs/comm/rts-libs/multi-thread.html +++ b/ghc/docs/comm/rts-libs/multi-thread.html @@ -28,7 +28,7 @@ OS threads may safely call Haskell functions concurrently. Section -

Calling out

+

The problem: foreign calls that block

When a Concurrent Haskell(CH) thread calls a 'foreign import'ed function, the runtime system(RTS) has to handle this in a manner @@ -48,25 +48,45 @@ threads (pthreads) and one for the Win32 threads.

Multi-threading the RTS

-From an RTS perspective, a simple and efficient way to implement this -is to retain the property that only one OS thread is allowed to +A simple and efficient way to implement non-blocking foreign calls is like this: +

+

+The rest of this section describes the mechanics of implementing all +this. There's two parts to it, one that describes how a native (OS) thread leaves the RTS to service the external call, the other how the same thread handles returning the result of the external call back to the Haskell thread.