FFI: number of worker threads?
Seth Kurtzberg
seth at cql.com
Wed Jun 21 12:07:24 EDT 2006
Simon,
Thanks for the response.
The doc I was referring to is the library haddock doc for Control.Concurrent.
Seth
On Wed, 21 Jun 2006 12:41:52 +0100
Simon Marlow <simonmarhaskell at gmail.com> wrote:
> Seth Kurtzberg wrote:
> > I have a related question. The docs state that in some environments O/S threads are used when the -threaded flag is used with ghc, and non-O/S threads are used otherwise (presumably these are non-preemptive). Does this apply as well to the worker threads that are the subject of this email?
>
> It sounds like the docs are a bit unclear. Which bit of doc in
> particular are you referring to?
>
> forkIO always creates a lightweight thread. With -threaded, if a thread
> makes a safe foreign call, then that call might execute concurrently
> with other threads, because another OS thread (a worker thread) takes
> over in the runtime. In the HEAD (which will be 6.6), we now allow
> multiple OS threads in the runtime, so you also get to run multiple
> Haskell threads simultaneously, which is particularly useful if you have
> more than one CPU.
>
> Cheers,
> Simon
>
More information about the Glasgow-haskell-users
mailing list